504 Gateway Timeout
HTTP response status code 504 Gateway Timeout is a server error message that is returned to indicate that it is acting as a proxy or gateway, and it has received no HTTP response from the upstream server.
When the 504 Gateway Timeout status code is received, the server is first indicating that it is acting as a proxy or gateway for an upstream server. After the HTTP request has been received, an attempt to forward it to the upstream server was made but no HTTP response was received.
This is related to error 502 Bad Gateway status code, except, in that case, the server returns an invalid HTTP response or is otherwise misbehaving.
In the example, the client requests a resource and the server responds with a 504 Gateway Timeout status code because the server that it attempted to retrieve the resource from did not return a HTTP response.
GET /news HTTP/1.1 Host: www.example.ai
HTTP/1.1 504 Gateway Timeout Content-Type: text/html; charset=UTF-8 Content-Length: 134 <html> <head> <title>Gateway Timeout<\title> </head> <body> <p>The server is is not responding.</p> </body> </html>
Apache HttpComponents Core
The 504 Gateway Timeout status code is a server error that indicates an upstream server is not responding and the HTTP request cannot be completed.