The client took too long to send the request.
When to use it
Idle connections. Clients can safely retry.
Common causes and fixes
The server closed the connection because the client didn’t send a complete request in time. Common causes: slow mobile networks during large uploads, connections opened speculatively by browsers that then send nothing, and keep-alive connections idling past the server limit. In nginx the timers are client_header_timeout and client_body_timeout, both 60 seconds by default.
Browsers retry transparently when an idle keep-alive connection is closed, so users rarely see 408; you mostly notice it in access logs, where entries with no request line come from preconnects and are harmless. For big uploads on slow links, raise client_body_timeout or switch to chunked, resumable uploads. Clients can safely retry, since the server never processed the request.
Client error (4xx)
4xx codes are client errors: the request itself is wrong, unauthorised or points at something that isn’t there. Retrying the same request won’t help.
What it looks like
HTTP/1.1 408 Request TimeoutHow to send it
| Node.js / Express | res.status(408).end() |
|---|---|
| Python / Flask | return '', 408 |
| nginx | return 408; |
How to check it
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/