Skip to content

Instantly share code, notes, and snippets.

@kindy
Created December 21, 2012 03:34
Show Gist options
  • Save kindy/4350497 to your computer and use it in GitHub Desktop.
Save kindy/4350497 to your computer and use it in GitHub Desktop.
demo config for nginx http upstream check
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