HTTP 504 Gateway Timeout (HTTP 504 Gateway Timeout)
HTTP 504 Gateway Timeout indicates that a gateway or proxy did not receive a timely response from an upstream server. It is an HTTP response from an intermediary, not the same event as a client-side timeout with no HTTP response.
Explanation
Locate the clock that expired
A client, forward proxy, website gateway and application can each have waiting limits. MDN defines 504 in terms of the gateway’s upstream wait. If the client stops waiting first, the application may report a local timeout without ever receiving a 504. Keep those outcomes separate in logs and success-rate calculations.
Longer client waits cannot change another node’s limit
Increasing a client timeout does not automatically extend a gateway’s upstream deadline. It may only let the client wait long enough to receive the same error. Diagnose which component waited and what it was waiting for before changing values across the system.
An illustrative multi-stage request
An authorized request can connect to the proxy successfully and later encounter a website gateway that times out waiting for an application. Entry reachability remains true while business completion fails. Record the last successful stage and any available request identifier, rather than declaring every component unavailable.
A timeout is not proof of no side effects
For an operation that changes data, a missing timely response does not establish that the application did nothing. Check its operation status or supported recovery mechanism before issuing another write. For permitted read requests, use bounded waiting and retries consistent with the target’s guidance; distinguish a recovered request from uninterrupted availability.
Related concepts
References
Sources checked on November 19, 2026. Examples illustrate concepts and are not proxy-service measurements.
Frequently Asked Questions
No. A local client exception can occur without receiving an HTTP response. Preserve the exception and response status separately.
No. It does not change the upstream waiting limit enforced by another gateway.
No. Both concern gateway behavior, but 504 describes a response not arriving in time, while 502 describes an invalid upstream response.