Created
February 15, 2017 17:30
-
-
Save devigned/4c9c064babab644253333db25a662723 to your computer and use it in GitHub Desktop.
Nginx config for Rails puma
This file contains 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 { | |
server unix:///home/deploy/apps/level0/shared/tmp/sockets/level0-puma.sock; | |
} | |
server { | |
listen 80 default_server deferred; | |
# server_name example.com; | |
root /home/deploy/apps/level0/current/public; | |
access_log /home/deploy/apps/level0/current/log/nginx.access.log; | |
error_log /home/deploy/apps/level0/current/log/nginx.error.log info; | |
location ^~ /assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
} | |
try_files $uri/index.html $uri @puma; | |
location @puma { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://puma; | |
} | |
error_page 500 502 503 504 /500.html; | |
client_max_body_size 10M; | |
keepalive_timeout 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment