408 Request Timeout: what it means and how it differs from 504

A 408 means the client was too slow to send its request. The usual causes, the server timeouts to check, and when it's just harmless keep-alive noise.

· 3 min read · By the Spot Downtime team

408 Request Timeout is easy to confuse with 504 Gateway Timeout, but it points the other way. A 504 means the server was too slow to answer. A 408 means the client was too slow to finish sending its request, so the server stopped waiting.

Why a client is “too slow”

  • A slow or unstable connection. Mobile networks, a weak Wi-Fi signal or a congested VPN stall partway through an upload.
  • Large uploads. The body takes longer to send than the server's body timeout allows.
  • Idle connections. A client opens a keep-alive connection and sends nothing. Some servers answer with 408 when they close it, which shows up in logs even though no user saw an error.
  • A client bug. The client says it will send a 10 KB body (Content-Length) and sends less, so the server waits for the rest until it gives up.

Fixing it on the server

Check the timeouts

nginx waits 60 seconds by default between reads of the request header and body. For an upload endpoint used on slow connections, raise it for that location only:

nginx
location /upload {
    client_body_timeout 300s;
    client_max_body_size 200m;
}

Apache's equivalent is RequestReadTimeout (mod_reqtimeout). Node.js servers have server.requestTimeout and server.headersTimeout. Load balancers have their own idle timeouts; the shortest one in the chain wins.

Don't send big files through your app

For large uploads, let the browser send directly to object storage (S3, R2, GCS) with a pre-signed URL, ideally in chunks that can be retried. Your server never holds a slow connection open.

Ignore keep-alive noise

408s with no request path in the access log are usually idle connections being closed. They're harmless. Filter them out so they don't hide real problems.

Fixing it as a visitor

Retry on a better connection, turn off a VPN or proxy, or upload a smaller file. If it happens on every site, the problem is your network.

Website speed testTime each step of loading a page (DNS, connection, TLS, server response and download) to see where the delay is.

408 vs 504, quickly

408: the server waited for you. 504: a proxy waited for the server behind it. If your monitoring shows 408s from a healthy client, look at timeouts in front of your app; for 504s, read 502 vs 503 vs 504.

Keep reading