Last active
August 29, 2015 14:14
-
-
Save coalwater/24ec63c60d0bbf35f510 to your computer and use it in GitHub Desktop.
nginx config for puma
This file contains hidden or 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
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