TrueURL

431 Request Header Fields Too Large

The server refuses the request because its headers are too large, usually because the browser sends too many or too large cookies.

Reason phrase
Request Header Fields Too Large
Redirect
No
Cacheable by default
No

431 Request Header Fields Too Large (RFC 6585) means the server is unwilling to process the request because a single header field, or all of them together, are too large. The client can retry after reducing the size of the headers.

Cookies are the usual culprit: a site and its subdomains set more and more cookies until the Cookie header exceeds the server's limit. Very long Referer URLs and large authentication tokens can cause it too. Node.js, for example, answers 431 when headers exceed its limit, which developers often hit on localhost, where cookies from many local projects pile up.

Not every server uses 431. nginx, for example, returns 400 Bad Request with "Request Header Or Cookie Too Large" instead.

Example response

HTTP
HTTP/1.1 431 Request Header Fields Too Large
Connection: close

SEO and redirect checking

Crawlers send small headers without cookies, so they almost never trigger 431. If a redirect check returns 431, reduce the size of the custom headers or cookies you added.

Common causes and use cases

  • Cookies accumulated for a domain and its subdomains. Clear them, or set fewer and smaller cookies.
  • Large JWTs or other authorization headers.
  • Very long Referer headers from URLs with huge query strings.
  • A low header size limit in a Node.js server (--max-http-header-size), a proxy or a load balancer.

URL Redirect Checker

See every status code a URL returns, hop by hop, with the free TrueURL redirect checker.