Created
July 14, 2017 14:16
-
-
Save nm-harry/d512599242ee849f542d7b60df0d65b0 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
server { | |
listen 80; | |
server_name www.superwebsite.com; | |
root /var/www/html; | |
set $skip_cache 0; | |
if ($uri ~* ^/refinery) { | |
set $skip_cache 1; | |
} | |
if ($request_method = POST) { | |
set $skip_cache 1; | |
} | |
location ~* ^/refinery { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_redirect off; | |
proxy_pass http://refinery; | |
} | |
location / { | |
# Cache options | |
proxy_cache client_cache; | |
proxy_cache_revalidate on; | |
proxy_cache_lock on; | |
proxy_cache_valid 200 302 301 5m; | |
# ?nocache=true bypass the cache | |
proxy_cache_bypass $skip_cache $arg_nocache; | |
# Ignore origin server headers for caching | |
proxy_ignore_headers Cache-Control; | |
proxy_ignore_headers Set-Cookie; | |
# Hide origin server headers in response | |
proxy_hide_header Cache-Control; | |
proxy_hide_header Set-Cookie; | |
proxy_hide_header X-Request-Id; | |
proxy_hide_header X-Runtime; | |
# Origin server | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_redirect off; | |
proxy_pass http://refinery; | |
} | |
upstream refinery { | |
server 127.0.0.1:3000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment