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.

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

Related status codes

All 5xx codes