Developer
Encoders, converters & dev utilities
504 Gateway Timeout
HTTP 504 Gateway Timeout. A server acting as a gateway or proxy did not get a timely response from the upstream server it needed to reach. When to use it: Returned by proxies/load balancers when the upstream does not respond within the allowed time. It is a server-error (5xx) status, which means the request was valid but the server failed to fulfil it. (Reference: RFC 9110 §15.6.5.)
A server acting as a gateway or proxy did not get a timely response from the upstream server it needed to reach.
- When to use: Returned by proxies/load balancers when the upstream does not respond within the allowed time.
- How to handle: Investigate why the upstream is slow (load, deadlocks, downstream dependency); raise timeouts only after fixing the root cause.
- Reference: RFC 9110 §15.6.5
- Category: 5xx Server Error
Frequently asked questions
What does HTTP 504 mean?
HTTP 504 Gateway Timeout: A server acting as a gateway or proxy did not get a timely response from the upstream server it needed to reach. It is a server-error (5xx) status, which means the request was valid but the server failed to fulfil it. It is defined in RFC 9110 §15.6.5.
What is the difference between 504 and 502?
504 Gateway Timeout means a gateway or proxy reached the upstream server but did not get a response within the allowed time — the upstream was too slow. 502 Bad Gateway means the gateway did get a response, but it was invalid or malformed. Both point at the upstream rather than the proxy itself: investigate upstream latency and health for 504, and upstream response validity for 502.