Skip to content

Instantly share code, notes, and snippets.

@osnysantos
Created October 21, 2016 17:33
Show Gist options
  • Save osnysantos/f192575d9dc47648e0563df742a90649 to your computer and use it in GitHub Desktop.
Save osnysantos/f192575d9dc47648e0563df742a90649 to your computer and use it in GitHub Desktop.
upstream app {
server unix:/home/deploy/myapp/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/deploy/myapp/current/public;
try_files $uri/index.html $uri @app;
location ~ /.well-known {
allow all;
}
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_pass http://app;
}
location ~ ^/(assets|fonts|system)/|favicon.ico|robots.txt {
gzip_static on;
expires max;
add_header Cache-Control public;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment