Created
March 9, 2012 22:05
-
-
Save JakubOboza/2008958 to your computer and use it in GitHub Desktop.
faye as subdomain
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
upstream faye { | |
server 127.0.0.1:9292; | |
} | |
upstream webrick{ | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80 default; | |
server_name faye.app.local; | |
root /Users/kuba/Workspace/Ruby/app_training; | |
access_log /var/log/nginx/faye.app.access.log; | |
location / { | |
proxy_pass http://faye; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} | |
server { | |
listen 80; | |
server_name app.local; | |
root /Users/kuba/Workspace/Ruby/app_training; | |
access_log /var/log/nginx/faye.app.access.log; | |
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://webrick; | |
break; | |
} | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment