Created
August 7, 2014 15:44
-
-
Save greatghoul/bc2adefc34857ed0c4f6 to your computer and use it in GitHub Desktop.
rails nginx conf
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 veakupes { | |
server unix:/home/wapech/applications/veakupes/current/tmp/pids/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 8005; | |
server_name _; | |
root /home/wapech/applications/veakupes/current/public; | |
try_files $uri/index.html $uri.html $uri @app; | |
location ~ ^/assets/ { | |
root /home/wapech/applications/veakupes/current/public; | |
gzip_static on; # to serve pre-gzipped version | |
expires 1y; | |
add_header Cache-Control public; | |
add_header ETag ""; | |
break; | |
} | |
location @app { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://veakupes; | |
} | |
# Rails error pages | |
error_page 500 502 503 504 /500.html; | |
location = /500.html { | |
root /home/wapech/applications/veakupes/current/public; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment