ACTIVITY

Timeline

Timeline for the post: Nginx returns 504 Gateway Timeout only for backend requests over ~45s to my Node API

Currently licensed under: CC BY-SA 4.0

2 Events
WhenWhatByLicenseComment
Nov 7, 2026, 9:46:16 AM
3w ago
AnswerfilipstackCC BY-SA 4.0Start by reproducing the failing call directly against the Node port and through Nginx, then correlate timestamps from the two access logs. Use openssl/curl with --verbose to see the exact timing; run tcpdump on loopback to capture who sends the FIN/RST and at what time. If Nginx sends the FIN at ~60s and its error log says 'upstream timed out', increasing proxy_read_timeout is the expected test (do so on a non-production worker or with a quick rollback plan). If the upstream sends RST, instrument Node (run the same command as the service user) to observe where it blocks or returns an error. These verification steps locate whether Nginx or the Node app closes the socket.
Nov 7, 2026, 9:46:16 AM
3w ago
CreatedastridappsCC BY-SA 4.0Nginx returns 504 Gateway Timeout only for backend requests over ~45s to my Node API