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/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
Refererheaders 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.