Can X-Accel-Redirect set limit_conn

Is the settings of number of simultaneous connections only in location?

etc.

location /download/ {
limit_conn one 1;
}

Can add some header of X-Accel-Redirect?

it will be more flexible.

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 ( http://pastie.textmate.org/private/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:
    http://pastie.org/private/0ktyhglwvmpwjbocryfysg and see the entire
    sequenced logged
    http://pastie.textmate.org/private/za2vqdrbxy8paoqfx1mlmq

Is this correct nginx behavior? Is mongrel giving an incorrect
response to nginx?

Thanks for your help,
Sudara

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

upstream name_of_upstream{
server 127.0.0.1:5000 fail_timeout=0;
server 127.0.0.1:5001 fail_timeout=0;
}

fail_timeout gives you control over how nginx considers an upstream
inoperative.

Take a gander here for more information.
http://wiki.codemongers.com/NginxHttpUpstreamModule

Thanks,
Sudara

Oh, one thing to note with the issue.

Before we had fail_timeout set, it seemed to be set not to the default
in the wiki (10s), but to exactly 1 request.

Not sure if that is expected behavior…

Sudara

Hello!

On Tue, Sep 23, 2008 at 10:32:53AM +0200, Sudara wrote:

Oh, one thing to note with the issue.

Before we had fail_timeout set, it seemed to be set not to the default
in the wiki (10s), but to exactly 1 request.

Not sure if that is expected behavior…

If all upstream servers are down (based on max_fails and
fail_timeout) - the next request will initiate so called ‘quick
recovery’ and reset their down state. The request itself will
return 502, but this gives a chance for other requests to succeed.

Maxim D.