Created
July 27, 2011 07:49
-
-
Save ecylmz/1108878 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Your thin servers go here | |
upstream rails.ecylmz.com { | |
server 0.0.0.0:3000; | |
server 0.0.0.0:3001; | |
server 0.0.0.0:3002; | |
} | |
# The usual server | |
server { | |
listen 80; | |
server_name rails.ecylmz.com ; | |
access_log /home/ecylmz/foo/log/access.log; | |
error_log /home/ecylmz/foo/log/error.log; | |
root /home/ecylmz/foo/public; | |
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; | |
if (-f $request_filename/index.html) { | |
rewrite (.*) $1/index.html break; | |
} | |
if (-f $request_filename.html) { | |
rewrite (.*) $1.html break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://rails.ecylmz.com; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment