HTTP 408 · 4XX RFC 9110 §15.5.9 Cacheable: No Retryable: Yes (with backoff)

HTTP 408 Request Timeout: Root Causes & Production Fix Guide

HTTP 408 Request Timeout means the server closed an idle connection because the client did not finish transmitting the full request headers or body within the timeout window.

Top Root Causes of HTTP 408

Align Keep-Alive & Client Timeouts in Nginx

http {
    keepalive_timeout 65s;
    client_header_timeout 30s;
    client_body_timeout 60s;
    send_timeout 60s;
}

Verify with cURL

curl -i -sS --max-time 30 -X POST --data-binary @payload.json https://api.example.com/upload

Interactive Stack Diagnoser (HTTP 408)

Frequently Asked Questions

How is 408 Request Timeout different from 504 Gateway Timeout?

408 means the client took too long to send the request to the server; 504 means the server received the request but an upstream backend took too long to respond.

How do I prevent random 408/502 errors behind AWS ALB?

Set your backend server's `keepAliveTimeout` slightly higher than the load balancer's idle timeout (for example, 65s in Node.js/Nginx when ALB is 60s).

Should clients automatically retry 408 responses?

Yes, for idempotent requests (or POST requests protected by an `Idempotency-Key` header) using exponential backoff.

Related Status Guides & Header Tools