HTTP 408 diagnosis across a client, proxy, load balancer, and origin server

An http 408 Request Timeout means the responding server did not receive a complete request within its waiting period. To fix http 408, first identify which server or intermediary returned it, then check whether headers, an upload, or an idle connection stalled. Retry on a fresh connection only when replaying the operation is safe. RFC 9110 defines 408 and restricts automatic replay.

Start with the actual response and matching logs. Increasing every timeout obscures the failing phase; changing IP addresses cannot complete a request that the sender stopped transmitting.


Key Facts

  • HTTP 408 identifies an incomplete request at the responding server.
  • A 408 response alone does not identify the responsible network hop.
  • Unused connections can receive 408 responses.
  • Header, upload, and idle-connection timeouts require different checks.
  • A local timeout is not evidence that an HTTP 408 response arrived.
  • Automatic retries require replay safety.

What does an HTTP 408 response actually tell you?

A 408 describes request reception at the responding hop. Its 4xx classification does not establish that the user’s device caused the failure. See the broader HTTP status code reference for context.

An idle or preconnected socket can receive 408 even without an active application request. Correlate it with an actual failed operation before treating it as an upload failure. MDN explains unused-connection responses.

Inspect the raw response using the curl -i option, which includes response headers, and retain the status line and headers. The curl manual documents response inspection; our curl headers guide adds practical context.

Reproduce an HTTP response and a local timeout separately

The following local fixture deliberately returns 408 on /408 and waits five seconds without sending a response on /slow. It binds only to loopback on an automatically assigned port.

Save this as timeout_demo.py and run python3 timeout_demo.py using Python 3.8 or later, with the curl executable available on PATH. The printed commands use POSIX shell quoting; the script itself passes arguments directly to curl. Python documents the version requirement and quoting behavior of shlex.join().

from datetime import datetime, timezone
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
import json
import platform
import shlex
import subprocess
import tempfile
import threading
import time

class Handler(BaseHTTPRequestHandler):
    protocol_version = 'HTTP/1.1'

    def log_message(self, *args):
        pass

    def do_GET(self):
        if self.path == '/slow':
            time.sleep(5)
            self.close_connection = True
            return
        self.send_response_only(408, 'Request Timeout')
        self.send_header('Content-Length', '0')
        self.send_header('Connection', 'close')
        self.end_headers()
        self.close_connection = True

server = ThreadingHTTPServer(('127.0.0.1', 0), Handler)
server.daemon_threads = False
threading.Thread(target=server.serve_forever, daemon=True).start()
evidence = Path(tempfile.mkdtemp(prefix='http408-evidence-'))
base = 'http://127.0.0.1:' + str(server.server_port)
record = {
    'test_date_utc': datetime.now(timezone.utc).isoformat(),
    'python': platform.python_version(),
    'curl': subprocess.check_output(['curl', '--version'], text=True),
    'configuration': {
        'bind': base,
        'protocol': 'HTTP/1.1',
        '/408': 'Synthetic 408; Content-Length: 0; Connection: close',
        '/slow': 'No response bytes; close after 5 seconds'
    },
    'runs': []
}
try:
    for name, limit, path in [('http408', '10', '/408'), ('local-timeout', '1', '/slow')]:
        command = ['curl', '-q', '--noproxy', '*', '--http1.1', '-sS', '-i',
                   '--max-time', limit, base + path]
        result = subprocess.run(command, capture_output=True)
        (evidence / (name + '.stdout')).write_bytes(result.stdout)
        (evidence / (name + '.stderr')).write_bytes(result.stderr)
        record['runs'].append({'name': name, 'command': command,
                               'exit_code': result.returncode})
        print('$ ' + shlex.join(command))
        print(result.stdout.decode(errors='replace'), end='')
        print(result.stderr.decode(errors='replace'), end='')
        print('exit_code=' + str(result.returncode))
    (evidence / 'qa.json').write_text(json.dumps(record, indent=2) + '\n')
    (evidence / 'timeout_demo.py').write_bytes(Path(__file__).read_bytes())
    print('Evidence directory: ' + str(evidence))
finally:
    server.shutdown()
    server.server_close()

The script waits for the sleeping request handler to finish during cleanup, so the complete run takes approximately five seconds even though the local curl timeout is one second. Setting server.daemon_threads = False overrides the default in ThreadingHTTPServer and makes cleanup wait for request threads, as described in Python’s server cleanup documentation.

The captured response below comes from the local synthetic fixture. It demonstrates receipt of an HTTP 408 response separately from a local curl timeout; it does not reproduce a production server’s request-reading timeout.

HTTP/1.1 408 Request Timeout
Content-Length: 0
Connection: close

exit_code=0

The separate /slow request produced this timeout message and exit code:

curl: (28) Operation timed out after 1000 milliseconds
exit_code=28

Without --fail, a completed HTTP error response normally leaves the curl exit code at 0. With --fail, an HTTP 408 response produces exit code 22. Exit code 28 identifies a local timeout and does not establish receipt of an HTTP response. The curl manual explains these options, and the error reference defines the exit codes.

A local timeout exception does not establish that an HTTP 408 response arrived. Keep the HTTP status, transport error, and application message separate.


How do you find which hop returned HTTP 408?

Find the emitting hop first, then identify whether headers, body transmission, or an unused connection exhausted its deadline. Treat response branding as a clue, not proof.

Record the timestamp with timezone, method, destination, request ID when available, payload size, and client version. Match these against edge, proxy, and origin logs. Ask each operator whether their server generated the status or forwarded it, and how much request data it received.

For proxy-only failures, compare authorized direct and proxied requests with the same method, body, destination, and comparable timing. A route difference implicates the path without isolating its cause. Follow the proxy troubleshooting checks before changing services.

Symptom -> check -> meaning -> fix

Symptom Check Meaning Fix
Upload stops Body progress and server read logs Request body stalled if logs confirm reception stopped Repair sender/network; adjust an evidenced limit
Headers incomplete Header-read logs Header deadline exceeded Correct sender or justify a longer deadline
Idle-only 408s Connection/request correlation Possibly an unused socket Confirm user impact before tuning
Proxy-only failure Matched direct/proxy requests and logs Path implicated, cause unresolved Repair the implicated hop
curl exit code 22 vs 28 HTTP status and exit code HTTP failure versus local timeout; see client diagnostics below Diagnose the corresponding layer

Find the hop that waited too long


What should you do about HTTP 408 in your role?

Choose actions you can verify from your side of the connection. Escalate with a reproducible request description rather than asking everyone to increase timeouts.

Role First action Evidence to retain
Visitor Retry safe navigation and check connectivity; check submission outcome before resending a form Time, page, action, and visible error
Developer Inspect header completion and upload progress Response, transmission trace, and payload characteristics
Server owner Inspect phase-specific logs and effective configuration Emitter, request phase, deadline, and received bytes
Scraper/API client Control replay and compare authorized routes Method, replay policy, route, and matched request results

For VMware/Horizon, fal.ai, Flightwall, Prusa, o2, WordPress, Retrofit, Netflix, FileZilla, Axie, or tracker reports, collect the actual response and application version first. A product name plus 408 is insufficient to select a product-specific cure.


How do you fix HTTP 408 on the relevant platform?

Match configuration changes to the phase confirmed by logs. A response-reading timeout cannot repair stalled request transmission.

nginx: headers, body, and keepalive

The relevant nginx limits govern different phases:

  • client_header_timeout: receiving the complete request headers.
  • client_body_timeout: gaps between successive body reads, not total upload duration.
  • keepalive_timeout: retaining an idle client connection.
  • send_timeout: gaps between writes to the client.

The first two can terminate request reception with 408. nginx documents these distinctions. Separately, proxy_read_timeout controls gaps while reading an upstream response. See its upstream-reading semantics and our nginx reverse proxy guide.

Inspect the effective configuration for the affected route. Do not assume a custom request header named Timeout overrides server policy; these controls are server directives.

Apache and HAProxy

Apache 2.4’s RequestReadTimeout controls reception deadlines and minimum data rates. Inspect the header/body settings and reqtimeout informational logs before changing either. Apache documents reception limits and logging.

In HAProxy 3.2, timeout http-request limits header reception by default; option http-buffer-request extends its scope to body buffering. Expiry sends 408 and records termination code cR. HAProxy’s versioned manual explains the behavior. With option http-buffer-request, HAProxy waits until the body is complete or the request buffer is full. Do not treat this as a whole-upload deadline for arbitrarily large bodies. See the body-buffering limits. Check your installed release before applying settings, and retain slow-request protections.

AWS ALB and proxy/CDN paths

For ALB-generated 408, AWS identifies missing client data before the idle limit expires. TCP keepalive does not prevent this timeout. Verify upload progress and the configured idle period; never insert arbitrary bytes into a request body. AWS documents ALB 408 troubleshooting.

Confirm whether the deployment uses Application Load Balancer or Classic Load Balancer before applying that guidance. For any CDN or proxy path, request logs identifying the status origin and stalled phase.

Chrome, JavaScript, PHP, and curl/Git

In Chrome DevTools, open Network and enable Preserve log before reproducing the failure. Select the request and inspect its Status and Headers. Distinguish an actual HTTP 408 response from a browser network failure without a response status. Chrome documents these Network panel controls.

In JavaScript, fetch() resolves for HTTP error responses; inspect response.status and response.ok. A rejected promise requires separate transport/error diagnosis. MDN distinguishes HTTP errors from fetch failures. For PHP cURL integrations, record HTTP transfer information separately from the cURL error number.

The curl/libcurl error 22 indicates an HTTP error with fail-on-error handling; error 28 indicates a local timeout. The official error reference defines both. Lowering a local time limit such as curl --max-time does not manufacture an HTTP 408 response. Check the local timeout option.

For git rpc failed http 408 curl 22, retain the HTTP response and investigate the upload route. Git 2.51.1 documents that raising the http.postBuffer limit is generally ineffective for most push problems. Read Git’s buffer guidance. Preserve these diagnostic distinctions when moving curl requests into Python.


How does HTTP 408 differ from 504, 499, 400, 409, and 429?

408 concerns incomplete request reception; it does not mean the server is busy. Use neighboring codes to select a different investigation.

Code Meaning and diagnostic direction
504 A gateway waited too long for an upstream response. Investigate upstream response timing. RFC 9110.
499 nginx logs this nonstandard code when the client closes the connection before nginx sends response headers. It is a log code, not an HTTP response the client received. Investigate the disconnect. nginx source definition.
400 A perceived client error, including malformed syntax or framing. Inspect request validity. RFC 9110.
409 Conflict with the resource’s current state. Resolve the conflict. RFC 9110.
429 Too many requests within a period. Examine API rate limiting. RFC 6585.

Should you retry HTTP 408, and how do you verify recovery?

Retry on a fresh connection only after establishing replay safety. RFC 9110 permits repeating an outstanding request after 408, but restricts automatic retries of non-idempotent operations. Review the retry constraints.

For writes, confirm the outcome or use the application’s documented deduplication mechanism. Set bounded attempts, backoff, and an overall deadline; see Python retry implementation guidance.

Repeat the same workload after the fix, preserving payload size and route. Compare client completion, received bytes, and edge/origin logs. Record software versions, configuration changes, timestamps, and raw responses. Confirm that the operation completed once and that the original stalled phase recovered.


Frequently Asked Questions

Is HTTP 408 a client or server problem?

The status identifies where request reception timed out, not who caused it. Investigate the sender, route, and responding server together.

Why does an upload fail while small requests work?

Compare upload progress with reception logs. Look for the point where bytes stopped arriving before selecting a timeout change.

Should I increase every timeout?

Change only the deadline implicated by evidence. Keep the original configuration so you can reverse an ineffective adjustment.

Can rotating proxies fix 408?

Investigate a proxy route when matched requests fail only through that route. Rotation cannot correct an incomplete request or change the receiving server’s deadline.

Is refreshing after 408 safe?

Prefer retrying ordinary navigation after checking connectivity. For a payment, form submission, or other write, check the outcome before repeating it.

What should I send to support?

Send the timestamp, application version, operation, response status, and request ID if available. Include whether the failure reproduces on another authorized route, and remove credentials from traces.


Investigating a proxy-specific timeout?

If matched requests implicate the proxy path, start with the proxy diagnosis guide and verify the failing hop before changing your setup.

Last updated: November 18, 2026.