Created
December 1, 2013 21:01
-
-
Save krasnoukhov/7740726 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
upstream balancer { | |
server app01.yoursite.com:3500 weight=1 max_fails=3; | |
server app02.yoursite.com:3500 weight=1 max_fails=3; | |
server app03.yoursite.com:3500 weight=1 max_fails=3; | |
} | |
server { | |
listen 80 default_server; | |
# Location of our static files | |
root /home/yoursite/public; | |
# Static | |
try_files $uri @app; | |
location @app { | |
proxy_redirect off; | |
proxy_pass http://balancer; | |
proxy_connect_timeout 75s; | |
proxy_read_timeout 120s; | |
proxy_send_timeout 120s; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment