Created
September 3, 2012 09:06
-
-
Save finger-berlin/3608016 to your computer and use it in GitHub Desktop.
nginx config for ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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