0%

nginx反向代理出现502错误,日志显示no live upstreams

出现oa单在签核的时候出现502错误,查看nginx错误日志出现no live upstreams while connecting to upstream

解决方案:

原upstream配置

1
2
3
4
5
6
 upstream oa{
ip_hash;
server 10.0.2.30:80;
server 10.0.2.17:80;
check interval=3000 rise=2 fall=2 timeout=1000 type=http;
}

修改后upstream配置

1
2
3
4
5
6
upstream oa{
ip_hash;
server 10.0.2.30:80 max_fails=3 fail_timeout=5s;
server 10.0.2.17:80 max_fails=3 fail_timeout=5s;
check interval=3000 rise=2 fall=2 timeout=1000 type=http;
}