Timeouts occur in two different ways. One is the request timeout, which is represented by HTTP response status code 408. Another flavor of timeout is the gateway timeout, which is represented by HTTP response status code 504.
The request timeout indicates that the server did not receive the complete request from the client within the specified time. In such a case, the server chose to close the connection with the client. The request timeout is an error message directly from the server.
The gateway timeout indicates that the gateway or the proxy server timed out while processing the request. In most cases, this is because the proxy or gateway do not receive a timely response from the actual server in the upstream.