408 Request Timeout
The server closed the connection because the client took too long to send the full request.
What 408 Request Timeout means
The server waited for the request headers or body and gave up. The client was slow to send; the server was not slow to respond.
Servers also send 408 when closing idle keep-alive connections, and the client can repeat the request. If a proxy gave up waiting for its backend, that is 504 Gateway Timeout instead.
Common causes
- A slow or unstable network connection, especially during large uploads.
- A client that opens a connection and then sends nothing for a while.
- A server or proxy with a very short client timeout.
How to fix 408 Request Timeout
- Retry the request and check your connection.
- Split large uploads into smaller chunks or use resumable uploads.
- On the server, review client_header_timeout and client_body_timeout in nginx (or the equivalent) if real users hit the limit.
Example response
HTTP/1.1 408 Request Timeout
Content-Type: text/plain; charset=utf-8
408 Request TimeoutHow to check for a 408 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 408) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 408:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 408 {
fmt.Println(res.Status)
}Specification
408 Request Timeout is defined in RFC 9110, section 15.5.9.
Related status codes
- 504
A gateway or proxy waited too long for a response from the upstream server and gave up before the page was ready.
- 413
The request body is bigger than the server is willing to accept, usually because an upload is over the size limit.
- 429
You sent too many requests in a short time and hit a rate limit. Wait, then retry, ideally after the Retry-After time.