upstream xxServer {
#ip_hash;
server ip1:port weight=1 max_fails=2 fail_timeout=30s ;
server ip2:port weight=1 max_fails=2 fail_timeout=30s ;
//nginx探活配置
check interval=3000 default_down=true rise=2 fall=5 timeout=1000 type=http;
check_http_send "GET /uis-wxvipfront/ HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
//nginx cookie
sticky name=uiswxvipfrontroute path=/uis-wxvipfront;
}
探活:https://blog.51cto.com/icenycmh/2091910
使用nginx sticky实现基于cookie的负载均衡 http://www.ttlsa.com/nginx/nginx-modules-nginx-sticky-module/