504 Gateway Timeout

HTTP 504 Gateway Timeout: the IANA registry entry, its reference and class, what it means and what usually causes it.

Updated

HTTP 504 Gateway Timeout is a registered status code in the 5xx Server Error class.

IANA registration

Field Value
Code 504
Description, as registered Gateway Timeout
Reference RFC 9110, Section 15.6.5
Class 5xx Server Error

Source: IANA Hypertext Transfer Protocol (HTTP) Status Code Registry, as downloaded on December 5, 2026. The registry changes over time; the linked page is the authority.

The 5xx class

The first digit of a status code gives its class. A 5xx (Server Error) code means the server failed to fulfil an apparently valid request. A client that does not recognize a particular code can treat it as the x00 code of its class. The classes are defined in RFC 9110, Section 15.

What it means in practice

This section is written by Network Utility. It is not part of the IANA registry.

A server acting as a gateway or proxy did not get a response in time from the upstream server it needed.

What usually causes it. Typical causes are a slow database query or external call that outlasts the proxy's timeout, an overloaded application, and a firewall silently dropping packets between the proxy and the upstream. Compare the proxy's timeout with how long the request really takes, then find out why it is slow.

See also: 502 Bad Gateway, with a comparison of 502, 503 and 504.