Skip to content

504 Gateway Timeout (HTTP Status Code 504)

Updated: at 09:12 AM

The HTTP 504 (Gateway Timeout) status code indicates that a server acting as a gateway or proxy timed out while waiting for a response from an upstream server.

Key Characteristics

Common Causes

For System Administrators:

For Developers:

Example Response:

HTTP/1.1 504 Gateway Timeout
Content-Type: text/html
Content-Length: 199

<html>
<head>
    <title>504 Gateway Time-out</title>
</head>
<body>
    <h1>Gateway Time-out</h1>
    <p>The server didn't respond in time.</p>
</body>
</html>

Best Practices

Difference Between 503 and 504

This error often requires optimization and handling at the system architecture level to ensure service stability and availability.