Skip to content

Instantly share code, notes, and snippets.

@coalwater
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coalwater/24ec63c60d0bbf35f510 to your computer and use it in GitHub Desktop.
Save coalwater/24ec63c60d0bbf35f510 to your computer and use it in GitHub Desktop.
nginx config for puma
upstream puma_upstream { # rename this to be unique
server unix://path/to/sock;
}
server {
listen 80;
client_max_body_size 4G;
keepalive_timeout 10;
server_name example.com;
root /path/to/app/public;
try_files $uri @puma;
location @puma{
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $server_name;
proxy_redirect off;
proxy_pass http://puma_upstream; # use same upstream name as above
access_log /path/to/app/shared/log/nginx.access.log
error_log /path/to/app/shared/log/nginx.error.log;
}
location /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment