roles/nginx: Use a more descriptive variable name for bypassing the proxy_cache
Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
parent
3dcc5e1411
commit
942f45834f
@ -64,20 +64,20 @@ server {
|
|||||||
# Set X-Fastcgi-Cache header to "HIT", "MISS", "BYPASS", etc
|
# Set X-Fastcgi-Cache header to "HIT", "MISS", "BYPASS", etc
|
||||||
add_header X-Fastcgi-Cache $upstream_cache_status;
|
add_header X-Fastcgi-Cache $upstream_cache_status;
|
||||||
# Don't cache when user shift-refreshes (Pragma: no-cache) or when a user is logged in!
|
# Don't cache when user shift-refreshes (Pragma: no-cache) or when a user is logged in!
|
||||||
fastcgi_cache_bypass $http_pragma $logged_in;
|
fastcgi_cache_bypass $http_pragma $wordpress_logged_in;
|
||||||
fastcgi_no_cache $http_pragma $logged_in;
|
fastcgi_no_cache $http_pragma $wordpress_logged_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
include extra-security.conf;
|
include extra-security.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if a user is logged in
|
# Check if a user is logged in
|
||||||
# if so, set $logged_in = 1
|
# if so, set $wordpress_logged_in = 1
|
||||||
# otherwise, set $logged_in = 0
|
# otherwise, set $wordpress_logged_in = 0
|
||||||
# See: http://jeradbitner.com/2012/02/nginx-do-not-cache-logged-in-drupal-or-wordpress-users/
|
# See: http://jeradbitner.com/2012/02/nginx-do-not-cache-logged-in-drupal-or-wordpress-users/
|
||||||
# See: http://syshero.org/post/50053543196/disable-nginx-cache-based-on-cookies
|
# See: http://syshero.org/post/50053543196/disable-nginx-cache-based-on-cookies
|
||||||
# See nginx bug: http://trac.nginx.org/nginx/ticket/707
|
# See nginx bug: http://trac.nginx.org/nginx/ticket/707
|
||||||
map $http_cookie $logged_in {
|
map $http_cookie $wordpress_logged_in {
|
||||||
default 0;
|
default 0;
|
||||||
|
|
||||||
~wordpress_logged_in 1;
|
~wordpress_logged_in 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user