<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">For anyone else looking at this issue, the following is an answer:<div><br></div><div>upstream name_of_upstream{</div><div>&nbsp;&nbsp;server 127.0.0.1:5000 fail_timeout=0;</div><div>&nbsp;&nbsp;server 127.0.0.1:5001 fail_timeout=0;</div><div>}</div><div><br></div><div>fail_timeout gives you control over how nginx considers an upstream inoperative.&nbsp;</div><div><br></div><div>Take a gander here for more information.</div><div><a href="http://wiki.codemongers.com/NginxHttpUpstreamModule">http://wiki.codemongers.com/NginxHttpUpstreamModule</a></div><div><br></div><div>Thanks,</div><div>Sudara</div><div><br></div><div><br></div><div><br><div><div>On Sep 22, 2008, at 10:38 AM, Sudara wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi guys,</div><div><br></div><div>1. I have Nginx proxying upstream to 3 mongrels</div><div><br></div><div>2. A request comes in that has a ridiculous and crazy URL</div><div><br></div><div>3. The url is passed to the mongrels, and each mongrel errors on the request (M<span class="Apple-style-span" style="font-family: Verdana; ">ongrel::HttpParserError: Invalid HTTP format, parsing fails.)&nbsp;</span></div><div><font class="Apple-style-span" face="Verdana"><br></font></div><div><font class="Apple-style-span" face="Verdana">4. Nginx tries each mongrel in the upstream, gets the same result from each (&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; "><a href="http://pastie.textmate.org/private/m9xjf7elqtmb2kwdtsbaa">http://pastie.textmate.org/private/m9xjf7elqtmb2kwdtsbaa</a> )&nbsp;<span class="Apple-style-span" style="font-family: Verdana; ">and passes a 502 to the client.</span></span></font></div><div><font class="Apple-style-span" face="Verdana"><br></font></div><div><font class="Apple-style-span" face="Verdana">5. On the next request, Nginx never tries the upstream. Nginx returns a 502 for this next without checking the upstream. In this case, a real request is lost because (maybe) Nginx thinks that the upstream is invalid. See my strace:</font></div><div><a href="http://pastie.org/private/0ktyhglwvmpwjbocryfysg">http://pastie.org/private/0ktyhglwvmpwjbocryfysg</a> and see the entire sequenced logged&nbsp;<a href="http://pastie.textmate.org/private/za2vqdrbxy8paoqfx1mlmq">http://pastie.textmate.org/private/za2vqdrbxy8paoqfx1mlmq</a></div><div><br></div><div><font class="Apple-style-span" face="Verdana">Is this correct nginx behavior? Is mongrel giving an incorrect response to nginx?</font></div><div><font class="Apple-style-span" face="Verdana"><br></font></div><div><font class="Apple-style-span" face="Verdana">Thanks for your help,</font></div><div><font class="Apple-style-span" face="Verdana">Sudara</font></div><div><font class="Apple-style-span" face="Verdana"><br></font></div><div><font class="Apple-style-span" face="Verdana"><br></font></div></div></blockquote></div><br></div></body></html>