Created
June 22, 2013 23:36
-
-
Save caquino/5843118 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 staticcontent { | |
keepalive 128; | |
server backend-01:80 max_fails=5 fail_timeout=15s; | |
server backend-02:80 max_fails=5 fail_timeout=15s; | |
server backend-03:80 max_fails=5 fail_timeout=15s; | |
server backend-04:80 max_fails=5 fail_timeout=15s; | |
} | |
upstream dynamiccontent { | |
keepalive 128; | |
ip_hash; | |
server backend-01:80 max_fails=5 fail_timeout=15s; | |
server backend-02:80 max_fails=5 fail_timeout=15s; | |
server backend-03:80 max_fails=5 fail_timeout=15s; | |
server backend-04:80 max_fails=5 fail_timeout=15s; | |
} | |
server { | |
listen 80; | |
location ~* \.(ico|js|css|png|gif|jpe?g|swf|txt|html?|htc)$ { | |
expires 7d; | |
proxy_next_upstream error timeout invalid_header http_500 updating; | |
proxy_cache_valid 200 7d; | |
proxy_set_header Host $host; | |
proxy_pass http://staticcontent; | |
} | |
location / { | |
proxy_next_upstream error timeout invalid_header http_500 updating; | |
proxy_set_header Host $host; | |
proxy_pass http://dynamiccontent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment