DevKits
504

Gateway Timeout

5xx Server Error

Last updated:

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

Description

The proxy waited too long for the origin server. Common on serverless platforms (Vercel: 10s Hobby / 60s Pro, AWS Lambda: 30s API Gateway).

When to use

Automatic on proxies. In application code, prefer 500 or 503 for internal timeouts you detect yourself.

Also searched as

Developers commonly search for 504 using phrases like 504 gateway timeout · 504 error · http 504 · gateway timeout · 504 gateway timeout meaning · 504 status code. All refer to the same HTTP 504 Gateway Timeout response.

Specification

RFC 9110 §15.6.5

Examples

HTTP response
HTTP/1.1 504 Gateway Timeout
Content-Type: application/json

{"error":"Gateway Timeout"}
Node.js (Express)
res.status(504).json({ error: "Gateway Timeout" });
Go (net/http)
w.WriteHeader(http.StatusGatewayTimeout)
Python (Flask)
return jsonify({"error": "Gateway Timeout"}), 504

Debug 504 with these tools

Related status codes

All 5xx codes