Skip to content

Instantly share code, notes, and snippets.

@minakolta
Created May 29, 2013 13:46
Show Gist options
  • Save minakolta/5670357 to your computer and use it in GitHub Desktop.
Save minakolta/5670357 to your computer and use it in GitHub Desktop.
Ruby on rails Nginx configuration
upstream roryourdomain {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name ror.yourdomain.com;
gzip on;
location / {
root /var/www/ror.yourdomain;
index index.html index.htm ;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $host;
proxy_pass http://roryourdomain;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://roryourdomain;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment