系统相关
首页 > 系统相关> > nginx配置upstream并设置max_fails=1 fail_timeout=6000s后有几率出现502

nginx配置upstream并设置max_fails=1 fail_timeout=6000s后有几率出现502

作者:互联网

具体报错信息如下:

2020/12/08 09:52:18 [error] 6#6: *832 no live upstreams while connecting to upstream, client: 10.78.104.169, server: 127.0.0.1, request: "POST /api/ppy-ls/login/check HTTP/1.1", upstream: "http://api//ppy-ls/login/check", host: "10.7.6.151:8080", referrer: "http://10.7.6.151:8080/"

nginx.conf设置如下:

upstream api {
       # server 10.7.6.151:8208 max_fails=1 fail_timeout=6000s;
       # server 10.7.6.152:8208 max_fails=1 fail_timeout=6000s;
    #}

由于测试环境只开了151一台服务器,所以152的服务应该一直是失败状态的。
然后每次后端发包的过程中都会导致151服务被标记为失败状态,从而导致每次后端包更新的瞬间访问失败后就会导致一直报502。(==)

标签:fails,10.7,max,server,6000s,api,timeout,upstream,fail
来源: https://blog.csdn.net/weixin_44144211/article/details/110878768