I have nginx set up as proxy to node.js for long polling like this:
location /node1 {
access_log on;
log_not_found on;
proxy_pass http://127.0.0.1:3001/node;
proxy_buffering off;
proxy_read_timeout 60;
break;
}
Unfortunately about half of long poll requests returns with error and empty response. My version of nginx is the one dreamhost offers v.0.8.53 and long poll request should be queues on the server for about 30seconds.
The case is that:
querying node.js directly like:
curl --connect-timeout 60 --max-time 60 --form "username=User" http://127.0.0.1:3001/node/poll/2/1373730895/0/0
works fine, but going through nginx:
curl --connect-timeout 60 --max-time 60 --form "username=User" http://www.mydomain.com/node1/poll/2/1373730895/0/0
is failing in half cases - the failed cases do not appear in the nginx access_log (the successful ones are there) and the curl returns: curl: (52) Empty reply from server
It might be connected with higher traffic volume as well as I don't see that yet on other site that has lower traffic and should have pretty much similar settings.
I will be very grateful for any help on that issue or hints how to further debug it.