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/1.1 504 Gateway Timeout
Content-Type: application/json
{"error":"Gateway Timeout"}res.status(504).json({ error: "Gateway Timeout" });w.WriteHeader(http.StatusGatewayTimeout)
return jsonify({"error": "Gateway Timeout"}), 504Debug 504 with these tools
Related status codes
Request Timeout
The server did not receive a complete request within the time it was prepared to wait.
Bad Gateway
The server, acting as a gateway or proxy, received an invalid response from the upstream server.
Service Unavailable
The server is currently unable to handle the request due to temporary overloading or maintenance.