Skip to content

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

Key points

  • 408 means the client was slow; 504 means an upstream server was.
  • Large uploads on slow connections are the usual trigger.
  • Idle reused connections can produce 408s that clients retry invisibly.
  • Load balancers often log 408s that never reach your application.

What 408 means

The server opened a connection and did not receive a complete request within its timeout. It closes the connection and may send 408 as a courtesy. Your application probably never saw the request at all, which is why application logs tend to show nothing.

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.

bash
# 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 -5

Fixes

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.

Frequently asked questions

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

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.