Skip to content

408 Request Timeout

The server closed the connection because the client took too long to send the full request.

What 408 Request Timeout means

The server waited for the request headers or body and gave up. The client was slow to send; the server was not slow to respond.

Servers also send 408 when closing idle keep-alive connections, and the client can repeat the request. If a proxy gave up waiting for its backend, that is 504 Gateway Timeout instead.

Common causes

  • A slow or unstable network connection, especially during large uploads.
  • A client that opens a connection and then sends nothing for a while.
  • A server or proxy with a very short client timeout.

How to fix 408 Request Timeout

  1. Retry the request and check your connection.
  2. Split large uploads into smaller chunks or use resumable uploads.
  3. On the server, review client_header_timeout and client_body_timeout in nginx (or the equivalent) if real users hit the limit.

Example response

HTTP/1.1 408 Request Timeout
Content-Type: text/plain; charset=utf-8

408 Request Timeout

How to check for a 408 response

cURL

# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/

JavaScript (Node.js)

const res = await fetch("https://example.com/");
if (res.status === 408) {
  console.log(res.status, res.statusText);
}

Python

import requests

res = requests.get("https://example.com/")
if res.status_code == 408:
    print(res.status_code, res.reason)

Go

res, err := http.Get("https://example.com/")
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 408 {
	fmt.Println(res.Status)
}

Specification

408 Request Timeout is defined in RFC 9110, section 15.5.9.

  • 504

    Gateway Timeout

    A gateway or proxy waited too long for a response from the upstream server and gave up before the page was ready.

  • 413

    Content Too Large

    The request body is bigger than the server is willing to accept, usually because an upload is over the size limit.

  • 429

    Too Many Requests

    You sent too many requests in a short time and hit a rate limit. Wait, then retry, ideally after the Retry-After time.

← all 63 HTTP status codes

Type to search posts, tools and projects.

Keyboard shortcuts

Search+Kor/
Go to homegthenh
Go to bloggthenb
Go to projectsgthenp
Go to timelinegthent
Show this help?
Close search or helpesc