CodePark/ questions / Status codes
START PRACTICINGPRACTICE
Backend question · HTTP & API design › Status codes

Nginx proxies requests to your Node service. The service accepts the connection but takes 90 seconds to reply, and Nginx gives up after 60. What status does the client most likely get?

504 Gateway Timeout

504 means a gateway or proxy did not get a response from the upstream (the server behind it) in time. Here Nginx waited 60 seconds and then gave up.

"502 Bad Gateway" is wrong because 502 means the upstream sent an invalid response. Examples are a refused connection or a crashed process. "503 Service Unavailable" is wrong because 503 means the server is overloaded or down for maintenance.