HTTP 431 Request Header Fields Too Large
Status code 431 · Class 4xx
Request Header Fields Too Large
Also searched as: error 431, HTTP 431, request header fields too large
What it means
The server refused the request because its headers, almost always the cookies, are too large. It typically appears on sites you have used for a long time or on localhost during development where many apps set cookies on the same host.
Applies to: All browsers, Node.js, nginx, REST APIs
How to fix HTTP 431 Request Header Fields Too Large
- Clear cookies for the site (or for 'localhost' during development) and reload
- Try a private window to confirm cookies are the cause
- Remove extensions that add large custom headers
- If you own the site: reduce cookie count and size; store session data on the server instead of in cookies
- If you own a Node.js app: the default maximum header size is limited; you can raise it with '--max-http-header-size' if large headers are legitimate
- If you own the site behind a proxy: align header buffer limits across CDN, proxy and app
Why it happens
RFC 6585 defines 431 for header sections that exceed the server's limit. Accumulated cookies from many subdomains or apps on the same host, and long auth tokens in headers, are the usual causes.
FAQ
Why do I get 431 on localhost?
Several development apps share the 'localhost' cookie jar. Clear localhost cookies in your browser and the error goes away.
Related errors
Source: IANA HTTP Status Code Registry · fixes written and reviewed by the editors (see our editorial policy)
Last updated: