<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Could it happen, that all servers reply
with HTTP 503?<br>
I suggest you could extend your logs with upstream_status variable
and if there is only one upstream reply status - try looking
through error logs.<br>
<br>
<br>
On 15.02.2017 20:17, Kaustubh Deorukhkar wrote:<br>
</div>
<blockquote
cite="mid:CADDqhk_enZRbYcFPx4iF+AW3gNiwH9kFd9bmWx6h4ojm=xTxUA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="font-size:12.8px">Hi,</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">We are using <span
class="gmail-m_7084673056195678499gmail-il">nginx</span> as
reverse proxy and have a set of upstream servers configured</div>
<div style="font-size:12.8px">with upstream next enabled for few
error conditions to try next upstream server.</div>
<div style="font-size:12.8px">For some reason this is not
working. Can someone suggest if am missing something?</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">http {</div>
<div style="font-size:12.8px">...</div>
<div style="font-size:12.8px"> upstream myservice {</div>
<div style="font-size:12.8px"> server localhost:8081;</div>
<div style="font-size:12.8px"> server localhost:8082;</div>
<div style="font-size:12.8px"> }</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"> server {</div>
<div style="font-size:12.8px"> ...</div>
<div style="font-size:12.8px"> location / {</div>
<div style="font-size:12.8px"> proxy_pass <a
moz-do-not-send="true" href="http://myservice/"
target="_blank">http://myservice</a>;</div>
<div style="font-size:12.8px"> proxy_next_upstream error
timeout invalid_header http_502 http_503 http_504;</div>
<div style="font-size:12.8px"> }</div>
<div style="font-size:12.8px"> }</div>
<div style="font-size:12.8px">}</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">So what i want is if any upstream
server gives the above errors, it should try </div>
<div style="font-size:12.8px">the next upstream instance, but it
does not and just reports error to clients.</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">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 <span
class="gmail-m_7084673056195678499gmail-il">nginx</span> closes
the current upstream connection where it received early
response, but i expect <span style="font-size:12.8px">it to
try the next upstream server as configured for the same
request before it responds with error to client.</span></div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Am I missing some <span
class="gmail-m_7084673056195678499gmail-il">nginx</span> trick
here?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
</blockquote>
<p><br>
</p>
</body>
</html>