Skip to content

Instantly share code, notes, and snippets.

@intinig
Created January 15, 2015 14:49
Show Gist options
  • Select an option

  • Save intinig/45a20124ba6c407807cb to your computer and use it in GitHub Desktop.

Select an option

Save intinig/45a20124ba6c407807cb to your computer and use it in GitHub Desktop.
upstream rgts {
server unix:/var/run/app0.sock;
server unix:/var/run/app1.sock;
}
server {
listen 80;
server_name ${NGINX_RGTS_HOST};
root /app/public;
location / {
try_files $uri/index.html $uri @rgts;
}
location @rgts {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
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;
}
client_max_body_size 4G;
keepalive_timeout 10;
location ^~ /assets/ {
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