Welcome! Log In Create A New Profile


Nginx hangs when proxy_passing to nodejs

Posted by sapporo78 
Nginx hangs when proxy_passing to nodejs
May 20, 2020 01:23PM

Could anyone give me some clue on how to troubleshooting such an issue. Here is my problem.

I'm setting up nginx as the reverse proxy for a new nodejs app. But when testing it, only 50% ~ 60% requests are passed to the nodejs app, other requests simple fail as a result of upstream timed out. The failure occurs even in a consistent way. The 1st request is successful, the 2nd request times out, then success, then timeout...

I even tried with a trivial expressjs app, which only respond to a GET request and send an empty response body. It fails in the same way. In the meantime, I'm use the same nginx instance to reverse proxy a Java app, it works well, no failure at all.

What I found is nginx didn't pass the requests to node in 50% of the time, it was just hanging there until timeout.

What should I check? What nginx or network setting may lead to such behavior? Thanks in advance!

My Env:
CentOS 8
nginx 1.14.1
nginx and the apps are on the same virtual machine
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready