Skip to content

Instantly share code, notes, and snippets.

@intinig
Created March 23, 2015 16:50
Show Gist options
  • Save intinig/aab475e3562d6a5cea89 to your computer and use it in GitHub Desktop.
Save intinig/aab475e3562d6a5cea89 to your computer and use it in GitHub Desktop.
upstream rgts {
server unix:/var/run/rgts.sock max_fails=0;
}
server {
listen 80;
server_name ${NGINX_RGTS_HOST};
root /var/static;
client_max_body_size 4G;
keepalive_timeout 10;
location / {
try_files $uri/index.html $uri @rgts;
add_header Pragma "no-cache";
add_header Cache-control "no-store";
}
location @rgts {
add_header Pragma "no-cache";
add_header Cache-control "no-store";
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_pass http://rgts;
}
location ~ ^/(assets|fonts|pdfs)/ {
try_files $uri @rgts;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment