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"}), 504Related status codes
408502503
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.