Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Created August 7, 2014 15:44
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 greatghoul/bc2adefc34857ed0c4f6 to your computer and use it in GitHub Desktop.
Save greatghoul/bc2adefc34857ed0c4f6 to your computer and use it in GitHub Desktop.
rails nginx conf
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