Skip to content

Instantly share code, notes, and snippets.

@oogali
Created October 5, 2012 09:04
Show Gist options
  • Save oogali/3838845 to your computer and use it in GitHub Desktop.
Save oogali/3838845 to your computer and use it in GitHub Desktop.
nginx + unicorn template
upstream APPNAME_unicorn_server {
server unix:/tmp/.APPNAME_sock_hodor;
}
server {
listen PORT;
server_name _;
keepalive_timeout 5;
root /home/APPNAME/current/public;
location / {
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://APPNAME_unicorn_server;
break;
}
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /home/APPNAME/current/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment