Nginx returns 502 and drops the next request without checking upstream

Sudara swilliams at
Tue Sep 23 12:30:04 MSD 2008

For anyone else looking at this issue, the following is an answer:

upstream name_of_upstream{
   server fail_timeout=0;
   server fail_timeout=0;

fail_timeout gives you control over how nginx considers an upstream  

Take a gander here for more information.


On Sep 22, 2008, at 10:38 AM, Sudara wrote:

> Hi guys,
> 1. I have Nginx proxying upstream to 3 mongrels
> 2. A request comes in that has a ridiculous and crazy URL
> 3. The url is passed to the mongrels, and each mongrel errors on the  
> request (Mongrel::HttpParserError: Invalid HTTP format, parsing  
> fails.)
> 4. Nginx tries each mongrel in the upstream, gets the same result  
> from each ( 
> m9xjf7elqtmb2kwdtsbaa ) and passes a 502 to the client.
> 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:
> and see the entire  
> sequenced logged
> Is this correct nginx behavior? Is mongrel giving an incorrect  
> response to nginx?
> Thanks for your help,
> Sudara

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list