Created
March 19, 2014 13:41
-
-
Save wokamoto/9641888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
# : (略) | |
upstream backend { | |
server localhost:8080; | |
} | |
upstream backend_admin { | |
server master.server:8080; | |
} | |
server { | |
listen 80; | |
server_name _; | |
root /var/www/html; | |
set $proxy_path 'http://backend'; | |
set $do_not_cache 0; | |
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) { | |
set $do_not_cache 1; | |
set $proxy_path 'http://backend_admin'; | |
} | |
if ($request_method = POST) { | |
set $do_not_cache 1; | |
set $proxy_path 'http://backend_admin'; | |
} | |
if ($request_filename ~ .*\.php) { | |
set $do_not_cache 1; | |
} | |
location / { | |
include /etc/nginx/expires; | |
proxy_no_cache $do_not_cache; | |
proxy_cache_bypass $do_not_cache; | |
proxy_redirect off; | |
proxy_cache czone; | |
proxy_cache_key "$scheme://$host$request_uri$mobile"; | |
proxy_cache_valid 200 0m; | |
proxy_pass $proxy_path; | |
} | |
} | |
server { | |
listen 8080; | |
server_name _; | |
root /var/www/html; | |
# : (略) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment