# What does the HTTP 504 status code mean?

> HTTP 504 Gateway Timeout means a server acting as a gateway or proxy did not get a timely response from an upstream server, under RFC 9110.

*A cache can send a 504 too: RFC 9111 says a disconnected cache that cannot revalidate a stale response marked must-revalidate should generate a 504 unless another error code is more applicable.*

- Type: Explainer
- Section: Tech
- By: Tech Desk
- Published: 2026-11-12T23:40:30-05:00
- Updated: 2026-11-12T23:40:30-05:00
- Checked: 2026-11-12T23:39:27-05:00
- URL: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/

## Key facts

- HTTP 504 Gateway Timeout means a server acting as a gateway or proxy did not receive a timely response from an upstream server it needed to complete the request, under RFC 9110. Source: [RFC Editor (Internet Engineering Task Force)](https://www.rfc-editor.org/rfc/rfc9110.html). Confirmed 2026-11-12T23:39:15-05:00. Cite: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/#http-504-gateway-timeout-means-a-server-acting-as-a-gateway
- RFC 9110 defines a gateway, also called a reverse proxy, as an intermediary that acts as an origin server for the outbound connection and forwards requests inbound to another server. Source: [RFC Editor (Internet Engineering Task Force)](https://www.rfc-editor.org/rfc/rfc9110.html). Confirmed 2026-11-12T23:39:15-05:00. Cite: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/#rfc-9110-defines-a-gateway-also-called-a-reverse-proxy-as-an
- RFC 9111 says a disconnected cache must not reuse a stale response marked must-revalidate, and the error it generates should be 504 unless another code is more applicable. Source: [RFC Editor (Internet Engineering Task Force)](https://www.rfc-editor.org/rfc/rfc9111.html). Confirmed 2026-11-12T23:39:27-05:00. Cite: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/#rfc-9111-says-a-disconnected-cache-must-not-reuse-a-stale
- RFC 2616, published in June 1999, defined 504 in Section 10.5.5 and named DNS as one auxiliary server whose timeout could cause it. Source: [RFC Editor (Internet Engineering Task Force)](https://www.rfc-editor.org/rfc/rfc2616.html). Confirmed 2026-11-12T23:39:27-05:00. Cite: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/#rfc-2616-published-in-june-1999-defined-504-in-section-10-5
- The IANA HTTP Status Code Registry lists code 504 with the description Gateway Timeout and the reference RFC 9110, Section 15.6.5. Source: [Internet Assigned Numbers Authority (IANA)](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml). Confirmed 2026-11-12T23:39:15-05:00. Cite: https://factsdesk.com/tech/what-does-the-http-504-status-code-mean/#the-iana-http-status-code-registry-lists-code-504-with-the

The HTTP 504 (Gateway Timeout) status code means that a server acting as a gateway or proxy did not receive a timely response from an upstream server it needed to reach to complete the request, according to [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html), the IETF standard that defines HTTP semantics. In the words of [Section 15.6.5 of RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-504-gateway-timeout), "The 504 (Gateway Timeout) status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request."

## Who sends a 504

[Section 3.7 of RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-intermediaries) names three common forms of HTTP intermediary: proxy, gateway and tunnel. A proxy is a forwarding agent the client chooses, usually through local configuration rules. A gateway, also called a reverse proxy, acts as an origin server toward the client but forwards requests inbound to another server or servers, and the same section says gateways are often used for "accelerator" caching and to spread HTTP services across multiple machines for load balancing.

## How 504 compares with nearby codes

[RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-server-error-5xx) puts 504 in the 5xx (Server Error) class, which means the server is aware that it has erred or is incapable of performing the requested method. Nearby codes differ in who failed and how.

| Code | Name | What RFC 9110 says it means |
| --- | --- | --- |
| 504 | Gateway Timeout | A gateway or proxy did not receive a timely response from an upstream server |
| 502 | Bad Gateway | A gateway or proxy received an invalid response from an inbound server |
| 503 | Service Unavailable | The server cannot handle the request now because of a temporary overload or scheduled maintenance |
| 500 | Internal Server Error | An unexpected condition prevented the server from fulfilling the request |
| 408 | Request Timeout | The server did not receive a complete request message within the time it was prepared to wait |

The meanings are summarized from Sections [15.6.5](https://www.rfc-editor.org/rfc/rfc9110.html#name-504-gateway-timeout), [15.6.3](https://www.rfc-editor.org/rfc/rfc9110.html#name-502-bad-gateway), [15.6.4](https://www.rfc-editor.org/rfc/rfc9110.html#name-503-service-unavailable), [15.6.1](https://www.rfc-editor.org/rfc/rfc9110.html#name-500-internal-server-error) and [15.5.9](https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout) of RFC 9110. The two timeouts point in opposite directions: a 504 means the gateway gave up waiting on the server behind it, while a [408](https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout) means the server gave up waiting on the client's own request, which puts 408 in the 4xx client error class. A 502 means an answer came back but was invalid, and a 504 means no answer came back in time. The site also explains [500 Internal Server Error](/tech/what-does-the-http-500-status-code-mean/).

## When a cache sends a 504

A 504 does not always mean a slow server. [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html), the HTTP caching standard, tells caches to use the same code in two cases where they cannot reach the origin or are told not to.

| Directive | Set by | What RFC 9111 says the cache does |
| --- | --- | --- |
| must-revalidate | The server, on a response | If disconnected, it must send an error rather than reuse the stale response, and that error should be 504 unless another code is more applicable |
| only-if-cached | The client, on a request | A cache that honors it should answer with a stored response that fits the request, or with 504 |

The first row is from [Section 5.2.2.2 of RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html#name-must-revalidate), which says servers ought to use must-revalidate if and only if failure to validate a request could cause incorrect operation, such as a silently unexecuted financial transaction. The second row is from [Section 5.2.1.7](https://www.rfc-editor.org/rfc/rfc9111.html#name-only-if-cached), where the client is asking only for a stored response.

## Can a client retry after a 504?

[Section 9.2.2 of RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-idempotent-methods) sets the general retry rules. PUT, DELETE and the safe methods such as GET are idempotent, meaning several identical requests have the same intended effect as one, so they can be repeated automatically after a communication failure. A client should not automatically retry a non-idempotent method such as POST unless it has a way to know the request is idempotent or that the original was never applied, a proxy must not automatically retry non-idempotent requests, and a client should not automatically retry a failed automatic retry.

## What a server should send with a 504

For every 5xx code, [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-server-error-5xx) says that, except when responding to a HEAD request, the server should send a representation explaining the error situation and whether it is a temporary or permanent condition, and that a user agent should display that representation to the user. A 504 is also not heuristically cacheable: the [overview of status codes](https://www.rfc-editor.org/rfc/rfc9110.html#name-overview-of-status-codes) gives the heuristically cacheable codes in RFC 9110, by way of example, as 200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414 and 501, and says all other status codes are not.

## What changed and when

| Standard | Published | Where 504 is defined |
| --- | --- | --- |
| [RFC 2616](https://www.rfc-editor.org/rfc/rfc2616.html) | June 1999 | Section 10.5.5 |
| [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231.html) | June 2014 | Section 6.6.5 |
| [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html) | June 2022 | Section 15.6.5 |

[RFC 2616](https://www.rfc-editor.org/rfc/rfc2616.html#section-10.5.5), published in June 1999, defined 504 as a timeout from the upstream server named by the URI, giving HTTP, FTP and LDAP as examples, or from some other auxiliary server such as DNS, and added a note to implementors that some deployed proxies were known to return 400 or 500 when DNS lookups timed out. [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231.html#section-6.6.5), published in June 2014, obsoleted RFC 2616 and shortened the definition to the sentence used today, dropping the list of protocols, the DNS example and the note. [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html) was published in June 2022 on the Standards Track as STD 97 and obsoletes RFC 7231, as its header shows; the 504 definition moved to Section 15.6.5 with its wording unchanged. The [IANA registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) now points code 504 to RFC 9110, Section 15.6.5, and shows its last update as September 15, 2025.

## Sources

1. [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html), RFC Editor (Internet Engineering Task Force), 2022-06 (primary source)
2. [RFC 9111: HTTP Caching](https://www.rfc-editor.org/rfc/rfc9111.html), RFC Editor (Internet Engineering Task Force), 2022-06 (primary source)
3. [Hypertext Transfer Protocol (HTTP) Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml), Internet Assigned Numbers Authority (IANA), 2025-09-15 (primary source)
4. [RFC 7231: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content](https://www.rfc-editor.org/rfc/rfc7231.html), RFC Editor (Internet Engineering Task Force), 2014-06 (primary source)
5. [RFC 2616: Hypertext Transfer Protocol, HTTP/1.1](https://www.rfc-editor.org/rfc/rfc2616.html), RFC Editor (Internet Engineering Task Force), 1999-06 (primary source)

## Asked next

- [What does the HTTP 500 status code mean?](https://factsdesk.com/tech/what-does-the-http-500-status-code-mean/): HTTP 500 Internal Server Error means the server encountered an unexpected condition that prevented it from fulfilling the request, under RFC 9110.
- [What does the HTTP 502 status code mean?](https://factsdesk.com/tech/what-does-the-http-502-status-code-mean/): HTTP 502 Bad Gateway means a server acting as a gateway or proxy received an invalid response from an inbound server, under RFC 9110.
- [What does the HTTP 503 status code mean?](https://factsdesk.com/tech/what-does-the-http-503-status-code-mean/): HTTP 503 Service Unavailable means the server cannot handle the request now due to a temporary overload or scheduled maintenance, under RFC 9110.
- [What does the HTTP 404 status code mean?](https://factsdesk.com/tech/what-does-the-http-404-status-code-mean/): HTTP 404 Not Found means the server did not find a current representation for the target resource or is not willing to disclose that one exists.
- [What does the HTTP 400 status code mean?](https://factsdesk.com/tech/what-does-the-http-400-status-code-mean/): HTTP 400 Bad Request means the server cannot or will not process a request because of something it perceives to be a client error, under RFC 9110.
- [What does the HTTP 429 status code mean?](https://factsdesk.com/tech/what-does-the-http-429-status-code-mean/): HTTP 429 Too Many Requests means the user has sent too many requests in a given amount of time, which RFC 6585 calls rate limiting.
