408 Request Timeout: what it means and how to fix it
Meaning
408 Request Timeout means the server stopped waiting for the rest of your request and closed the connection. Resend it once on a new connection.
The server was still waiting for your request to finish arriving when its timer ran out, so it gave up and closed the connection. RFC 9110 section 15.5.9 defines “408 (Request Timeout)” as a server that “did not receive a complete request message within the time that it was prepared to wait”. The late bytes were yours. A page that takes too long to load is a different failure, reported by your own client timeout or by a gateway’s 504.
The same section says the client MAY repeat the request, and that a new connection will be used if the current one is not usable, as in HTTP/1.1, “because request delimitation is lost”. In practice: resend once, on a fresh connection.
Reproduce it with curl
Node.js 24.2.0 sends 408 itself when requestTimeout or headersTimeout expires. Its defaults are 300,000 ms and 60,000 ms, which we printed from http.createServer(). This server shortens both to 3 seconds:
// node408.mjs
import http from 'node:http';
const server = http.createServer(
{ requestTimeout: 3000, headersTimeout: 3000, connectionsCheckingInterval: 500 },
(req, res) => { req.resume(); req.on('end', () => res.end('received\n')); }
);
server.listen(37408, '127.0.0.1');
curl 8.23.0 then uploads 512 KiB at 20 KB per second, far too slowly to finish in 3 seconds:
$ head -c 524288 /dev/urandom > small.bin
$ curl -sv --limit-rate 20k --data-binary @small.bin http://127.0.0.1:37408/upload
* Trying 127.0.0.1:37408...
* Established connection to 127.0.0.1 (127.0.0.1 port 37408) from 127.0.0.1 port 64496
* using HTTP/1.x
> POST /upload HTTP/1.1
> Host: 127.0.0.1:37408
> User-Agent: curl/8.23.0
> Accept: */*
> Content-Length: 524288
> Content-Type: application/x-www-form-urlencoded
>
} [20480 bytes data]
< HTTP/1.1 408 Request Timeout
< Connection: close
<
* abort upload after having sent 81920 bytes
* shutting down connection #0
The exchange took 4.0 seconds of wall time against a 3-second limit, because Node only looks for expired requests every connectionsCheckingInterval. Node’s documentation describes requestTimeout as the time allowed “for receiving the entire request from the client”, so a slow upload trips it even while bytes keep flowing.
Not every server sends the 408
We opened a connection, sent half a request header (GET / HTTP/1.1 and a Host line, no blank line), then went quiet. Two runs per server, except Squid, which ran once:
| Server and setting | What came back | When |
|---|---|---|
Apache httpd 2.4.67, RequestReadTimeout header=3 body=3 |
HTTP/1.1 408 Request Timeout |
3.0 s, both runs |
| Node.js 24.2.0, settings above | HTTP/1.1 408 Request Timeout |
3.2 s and 3.3 s |
Python 3.15.0 http.server, timeout = 3 |
Connection closed, zero bytes | 3.0 s, both runs |
Squid 6.13, request_timeout 3 seconds |
Connection closed, zero bytes | 4.4 s |
Apache logged AH01382: Request header read timeout. Squid logged the attempt as NONE_NONE/000 0 - error:transaction-end-before-headers. A client facing a server that closes silently never sees a 408; curl reports curl: (52) Empty reply from server instead. So the absence of 408 in your logs does not mean nothing timed out.
Documented defaults, for when you control the server: nginx waits 60s for the header (client_header_timeout) and 60s between two body reads (client_body_timeout). Apache’s RequestReadTimeout defaults to header=20-40,MinRate=500 body=20,MinRate=500. Squid’s request_timeout is 5 minutes.
When a proxy returns 408
Read the headers before blaming the exit. We sent the same slow upload through Squid to the Node server above. The 408 arrived after 4.0 seconds with no Server: squid header and a Via header added (hostname masked):
< HTTP/1.1 408 Request Timeout
< Date: Wed, 21 Oct 2026 19:57:25 GMT
< Transfer-Encoding: chunked
< Via: 1.1 proxy-host (squid/6.13)
< Connection: keep-alive
* HTTP error before end of send, stop sending
* abort upload after having sent 81920 bytes
The origin timed out; Squid only relayed the verdict. Squid streamed the body to the origin as it arrived, so the client’s slowness reached the origin intact. A slow upstream link has the same effect as curl’s rate limit here, because the origin’s timer counts the bytes it receives, not the bytes you sent. If 408s appear only through one exit or one proxy pool, a sticky session on a faster exit is a reasonable test.
Browsers retry some 408s without telling you. A comment in Chromium’s http_network_transaction.cc sets the rule:
On a 408 response from the server (“Request Timeout”) on a stale socket, retry the request for HTTP/1.1 but not HTTP/2 or QUIC because those multiplex requests and have no need for 408.
A scraper library may not do the same, so add it yourself, and send the retry on a new connection. In our tests Apache 2.4.67 and Node 24.2.0 both closed idle keep-alive connections without sending an unsolicited 408, so that stale-socket case depends on the server.
Causes and fixes
| Cause | How to confirm it | What to change |
|---|---|---|
| Upload slower than the server’s request or body timeout | 408 arrives mid-upload; curl prints abort upload after having sent N bytes |
Smaller bodies, a faster route, or a longer timeout on a server you control |
| Connection opened early and left idle before the request | 408 or an empty reply on a connection that never sent a full request | Open connections when you have a request ready; write the headers in one call |
| Stale pooled connection | First request after an idle period fails; an immediate retry works | Retry once on a new connection; keep the pool’s idle timeout shorter than the server’s keep-alive |
| Slow proxy exit between you and the origin | Only proxied requests fail; Via present, origin’s own headers | Different exit or a sticky session on a faster one |
| Proxy’s own client timeout | Silent close, curl exit 52, only through the proxy | Raise the proxy’s request_timeout, or send the request sooner |
Cap the retries. Use exponential backoff after the first fresh-connection attempt, and set client timeouts as shown in Using proxies in Python or Using proxies in Node.js, so a stuck request fails on your side with a clear error instead of hanging.