Created
December 21, 2012 03:34
-
-
Save kindy/4350497 to your computer and use it in GitHub Desktop.
demo config for nginx http upstream check
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 cluster { | |
# simple round-robin | |
server 127.0.0.1:10002; | |
server 127.0.0.1:10003; | |
check interval=1000 rise=2 fall=5 timeout=500 type=http; | |
check_http_send "GET /status HTTP/1.0\r\n\r\n"; | |
check_http_expect_alive http_2xx http_3xx; | |
} | |
server { | |
listen 10001; | |
location / { | |
proxy_pass http://cluster; | |
} | |
location = /up-status { | |
check_status; | |
access_log off; | |
} | |
} | |
server { | |
listen 10002; | |
root html; | |
location / { | |
index index.html index.htm; | |
} | |
} | |
server { | |
listen 10003; | |
root html; | |
rewrite ^/status$ /status-3 break; | |
location / { | |
index index.html index.htm; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment