Troubleshooting guide
408 Request Timeout: causes and how to fix it
A 408 means the server waited for the client to finish sending its request and gave up. The slow side is the sender, the opposite of a 504.
3 min read10 sectionsUpdated
On this page
Common causes
- Slow uploads. A mobile client sending a large file cannot finish before
client_body_timeout. - A client that opens a connection and stalls, whether from a bug, a network drop or a slow-attack scanner.
- Idle keep-alive connections. Some load balancers send 408 on connections left idle, and clients see it as a spurious failure on the next reuse.
- Too-short timeouts set to defend against slow attacks, which also catch legitimate slow networks.
Diagnose it
Find out who generated it and how long the request took. On AWS ALB, a 408 with a target status of - means the target never received it.
# How often, and on which paths? (Nginx combined log)
awk '$9 == 408 {print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# Current Nginx timeouts
sudo nginx -T 2>/dev/null | grep -E 'client_(body|header)_timeout|keepalive_timeout'
# Simulate a slow upload (1 KB per second)
curl -si --limit-rate 1K -X POST -T large.bin https://example.com/upload | head -5Fixes
For uploads, send files directly to object storage with presigned URLs, or split them into resumable chunks, so a single connection does not need to last that long. Raise client_body_timeout only on upload routes rather than globally, because long timeouts everywhere make slow-connection attacks cheaper. Keep the backend's keep-alive timeout longer than the load balancer's idle timeout. On the client, safe retries of idempotent requests will absorb occasional 408s.
Catch it automatically
Because the application cannot see 408s, the load balancer's or proxy's logs are the only source. Send those to log management and chart 408s by path. Real-user monitoring shows whether failures concentrate on slower networks, which distinguishes a timeout that is too tight from a real outage.
What is the difference between 408 and 504?
408 means the client took too long to send the request. 504 means a gateway waited too long for an upstream server to respond.
Can a 408 be retried safely?
Yes, the server did not process the request, and clients such as browsers often retry automatically. Still make non-idempotent operations safe with idempotency keys.
Why does my application log nothing for these?
The proxy or load balancer usually returns the 408 before a complete request reaches your application.
Check it now, free
- Website down checker: Is it down for everyone or just me? Check any site now.
Related reading
- 400 Bad Request: what it means and how to fix it: Fix a 400 Bad Request error: oversized cookies, malformed URLs, invalid JSON bodies and proxy rules, with commands to find which layer rejected it.
- 503 Service Unavailable: causes and fixes: Why servers return 503 Service Unavailable, from overload and maintenance to no healthy backends, how to diagnose each cause and how to recover and prevent it.
- 414 URI Too Long: causes and how to fix it: Fix 414 URI Too Long errors: redirect loops that grow the URL, huge query strings and large GET filters, with Nginx and Apache settings and better designs.
- 422 Unprocessable Entity: how to fix it: Fix 422 Unprocessable Entity (Unprocessable Content): validation errors in APIs and forms, CSRF tokens in Rails and Laravel, and how to read the error body.
- 501 Not Implemented: how to fix it: Fix 501 Not Implemented: unsupported HTTP methods, servers and proxies that do not support PATCH or WebDAV, and how it differs from 405 and 500.
- 502 Bad Gateway: causes and how to fix it: What a 502 Bad Gateway means, the common causes behind Nginx, load balancers and CDNs, how to find yours and how to stop it happening again.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.