Skip to content
GGleamInsight
Wiki

HTTP 504 Gateway Timeout

HTTP 504 Gateway Timeout means a server acting as a gateway or proxy did not receive a timely response from an upstream server needed to complete the request.

Published 2 min readUpdated

Definition

HTTP 504 Gateway Timeout means a server acting as a gateway or proxy did not receive a timely response from an upstream server needed to complete the request.

A response from an intermediary

Unlike a local client timeout exception, 504 is an HTTP response that reached the client. It reports the responding gateway’s upstream wait. It does not identify a universal timeout duration; the deadline belongs to that deployment.

For an illustrative chain, a website’s reverse proxy might reach its backend deadline and return 504 through a functioning outbound proxy. Alternatively, the outbound proxy could be the waiting intermediary. Determine the responding hop from available evidence rather than inferring it from the code.

Several deadlines can overlap

The client, forward proxy, destination gateway, and application can have separate deadlines. The first deadline reached may determine what the client observes. A short client deadline may produce an exception before an intermediary returns its eventual HTTP response.

HTTPX documents distinct connection, read, write, and pool timeouts. These client controls are not the same as an upstream gateway’s timeout. Increasing a client setting does not change a remote operator’s deadline.

Investigate delay before increasing load

Record the request time, target, operation type, and available response identifiers. Check whether the failure is specific to a destination or path, and whether it coincides with increased parallel work. A single 504 cannot establish that the exit IP is blocked.

Use bounded retries only when the operation is safe to repeat. For state-changing work with an unknown outcome, query the result through the application’s supported mechanism first. Continually adding retries can increase load on an already delayed dependency.

Sources

Sources checked on November 18, 2026. Examples are illustrative, not measurements of a live proxy service.

Frequently asked questions

Is 504 the same as a client read timeout?

No. A 504 is a received HTTP gateway response; a client timeout can occur before any such response arrives.

Does increasing my client timeout fix 504?

Not necessarily. It does not alter the gateway’s own upstream deadline or repair the delayed dependency.

Does 504 prove the destination performed no action?

No. A delayed or missing response does not establish whether an operation was processed. Check uncertain outcomes before repeating state-changing work.