Skip to content

Instantly share code, notes, and snippets.

@damm
Created October 13, 2009 19:03
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 damm/209456 to your computer and use it in GitHub Desktop.
Save damm/209456 to your computer and use it in GitHub Desktop.
upstream unicorn {
server unix:/u/apps/something/shared/sockets/unicorn.sock;
}
server {
listen 80;
server_name something.com;
access_log /u/apps/something/current/log/access.log main;
error_log /u/apps/something/current/log/error.log error;
client_max_body_size 50m;
root /u/apps/something/current/public;
location @unicorn {
proxy_pass http://unicorn;
proxy_set_header X-Forwaded-For $proxy_add_x_forwaded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location @something {
root /u/apps/something/current/public;
}
location / {
try_files $uri $uri/ @unicorn;
}
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html last;
break;
}
error_page 500 502 503 504 /500.html;
error_page 404 /404.html;
location = /500.html {
try_files @something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment