Skip to content

Instantly share code, notes, and snippets.

@kiote
Created December 22, 2011 15:39
Show Gist options
  • Save kiote/1510717 to your computer and use it in GitHub Desktop.
Save kiote/1510717 to your computer and use it in GitHub Desktop.
upstream domain {
server unix:/home/www/domain/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name domain.ru www.domain.ru;
access_log /var/log/domain.ru/nginx-access.log;
error_log /var/log/domain.ru/nginx-error.log;
client_max_body_size 1G;
keepalive_timeout 5;
root /home/www/domain/current/public;
try_files $uri/index.html $uri.html $uri @contextedit;
location @domain {
proxy_pass http://domain;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /home/www/domain/current/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment