Skip to content

Instantly share code, notes, and snippets.

@finger-berlin
Created September 3, 2012 09:06
Show Gist options
  • Save finger-berlin/3608016 to your computer and use it in GitHub Desktop.
Save finger-berlin/3608016 to your computer and use it in GitHub Desktop.
nginx config for ruby
upstream myapp {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
server 127.0.0.1:3002;
}
server {
listen 80;
server_name .example.com;
access_log /var/www/myapp.example.com/log/access.log;
error_log /var/www/myapp.example.com/log/error.log;
root /var/www/myapp.example.com;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://myapp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment