Mysterious proxy timeout at 2 min

Hello

I am configuring nginx to proxy to a node.js server which I am using
for long-polling. I want nginx to hold the connection open just over 5
minutes so that the node server can respond with content, or at least
a 204, when it’s good and ready.

But nginx/1.1.0 keeps canceling with a 502 after exactly 2 minutes. I
can’t find a a 2-minute timeout anywhere in my config.

I have the following:

upstream nodesub {
server 127.0.0.1:8001;
}

location /sub {
send_timeout 330s;
proxy_read_timeout 330s;
proxy_connect_timeout 30s;
proxy_pass http://nodesub;
}

What am I missing, good people of the list?

Thomas

Hello!

On Wed, Aug 24, 2011 at 12:06:13PM +0200, Thomas L. wrote:

Hello

I am configuring nginx to proxy to a node.js server which I am using
for long-polling. I want nginx to hold the connection open just over 5
minutes so that the node server can respond with content, or at least
a 204, when it’s good and ready.

But nginx/1.1.0 keeps canceling with a 502 after exactly 2 minutes. I
can’t find a a 2-minute timeout anywhere in my config.

Error 502 suggests it’s not nginx timeout (error will be 504 then)
but backend’s one.

Maxim D.

On 24 August 2011 12:09, Maxim D. [email protected] wrote:

Error 502 suggests it’s not nginx timeout (error will be 504 then)
but backend’s one.

Maxim D.

Thanks. I thought it might be. I’m scouring node…

Thomas

On 24 August 2011 12:12, Thomas L. [email protected] wrote:

Found it. For any other node fanboys: there’s a hardcoded 120-second
idle timeout in node.js’s http.js, and to change it, call

request.socket.setTimeout(seconds * 1000);

Thomas