HTTP 504

HTTP 504 Gateway Timeout โ€” Meaning, Causes & How to Fix

The server, acting as a gateway or proxy, did not get a response in time from the upstream server.

Code
504
Name
Gateway Timeout
Class
5xx Server Error
Specification
RFC 9110 ยง15.6.5
Cacheable by default
Only with explicit Cache-Control / Expires

What HTTP 504 means

504 Gateway Timeout is returned by a proxy, load balancer or CDN when the upstream server did not reply within its time limit. The upstream may still be working on the request, so the operation could have partly completed.

Common causes

How to fix it

For site owners

For visitors & developers

SEO impact

Timeouts count as server errors for Googlebot: they reduce crawling, and slow servers get crawled less. Persistent 504s can drop URLs from the index.

Example 504 response

HTTP/1.1 504 Gateway Timeout
Server: nginx
Content-Type: text/html

Related status codes

502 ยท Bad Gateway503 ยท Service Unavailable408 ยท Request Timeout500 ยท Internal Server Error501 ยท Not Implemented505 ยท HTTP Version Not Supported

Check or look up another code

Search and filter every code in the HTTP Status Codes tool, browse the full list by class, or read HTTP status codes explained: the complete developer guide.

Open HTTP Status Codes tool โ†’All status codes

Frequently asked questions

What does HTTP 504 mean?

HTTP 504 Gateway Timeout is a 5xx Server Error status code. The server, acting as a gateway or proxy, did not get a response in time from the upstream server.

What is the difference between 504 and 408?

504: a gateway gave up waiting for the upstream server. 408: the server gave up waiting for the client to send the request.

Which specification defines 504?

It is defined in RFC 9110 ยง15.6.5.

Is a 504 response cacheable?

Not by default. A 504 response is only stored by caches when it carries explicit freshness information such as Cache-Control: max-age or Expires.

More PAYATE tools