Created
May 30, 2012 15:00
-
-
Save mattyoho/2836864 to your computer and use it in GitHub Desktop.
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
http { | |
upstream app_server { | |
# for UNIX domain socket setups: | |
server unix:/tmp/app.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
# server 127.0.0.1:8081 fail_timeout=0; | |
# server 127.0.0.1:8082 fail_timeout=0; | |
# server 127.0.0.1:8083 fail_timeout=0; | |
} | |
upstream auth_server { | |
# for UNIX domain socket setups: | |
server unix:/tmp/auth.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
# server 127.0.0.1:8084 fail_timeout=0; | |
# server 127.0.0.1:8085 fail_timeout=0; | |
# server 127.0.0.1:8086 fail_timeout=0; | |
} | |
upstream search_server { | |
# for UNIX domain socket setups: | |
server unix:/tmp/auth.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
# server 127.0.0.1:8087 fail_timeout=0; | |
# server 127.0.0.1:8088 fail_timeout=0; | |
# server 127.0.0.1:8089 fail_timeout=0; | |
} | |
server { | |
listen 80 default deferred; # for Linux | |
client_max_body_size 4G; | |
server_name _; | |
keepalive_timeout 5; | |
# path for static files | |
root /path/to/app/current/public; | |
try_files $uri/index.html $uri.html $uri @app; | |
location /chat { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://app_server; | |
} | |
location /search { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://search_server; | |
} | |
location /users { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://auth_server; | |
} | |
# Rails error pages | |
error_page 500 502 503 504 /500.html; | |
location = /500.html { | |
root /path/to/app/current/public; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment