Nginx 502 no live upstreams while connecting to upstream 问题
Nginx转发两个后端服务,请求返回502,没有进入到后端服务,排查Nginx日志发现:
no live upstreams while connecting to upstream造成该问题的原因:
转发到upstream两个节点的请求都出现了超时(upstream timed out (110: Connection timed out) while reading response header from upstream),Nginx认为upstream中的两个节点都挂掉了,无法使用,所以拒绝新请求的连接,返回502。
需要等待fail_timeout时间后,才能继续尝试转发,这是属于Nginx的被动健康检查机制。