Skip to content

Instantly share code, notes, and snippets.

@johndel
Created January 18, 2013 16:59
Show Gist options
  • Save johndel/4566072 to your computer and use it in GitHub Desktop.
Save johndel/4566072 to your computer and use it in GitHub Desktop.
upstream unicorn {
server unix:/tmp/unicorn.escortamazons.sock fail_timeout=0;
}
server {
server_name escortamazons.com;
rewrite ^ $scheme://www.escortamazons.com$request_uri permanent;
# permanent sends a 301 redirect whereas redirect sends a 302 temporary redirect
# $scheme uses http or https accordingly
}
server {
listen 80 deferred;
server_name www.escortamazons.com;
root /projects/ruby/ror/escortamazons/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment