<div dir="ltr"><div>Hi,</div><div><br></div><div>We are using nginx as reverse proxy and have a set of upstream servers configured</div><div>with upstream next enabled for few error conditions to try next upstream server.</div><div>For some reason this is not working. Can someone suggest if am missing something?</div><div><br></div><div>http {</div><div>...</div><div>  upstream myservice {</div><div>    server localhost:8081;</div><div>    server localhost:8082;</div><div>  }</div><div><br></div><div>  server {</div><div>    ...</div><div>    location / {</div><div>      proxy_pass <a href="http://myservice">http://myservice</a>;</div><div>      proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;</div><div>    }</div><div>  }</div><div>}</div><div><br></div><div>So what i want is if any upstream server gives the above errors, it should try </div><div>the next upstream instance, but it does not and just reports error to clients.</div><div><br></div><div>Note that, in my case one of the upstream server responds early for some PUT request with 503 before entire request is read by upstream. I understand that nginx closes the current upstream connection where it received early response, but i expect</div><div>it to try the next upstream server as configured for the same request before it responds with error to client.</div><div><br></div><div>Am I missing some nginx trick here?</div><div><br></div><div>Thanks in advance!</div></div>