431 Request Header Fields Too Large means the request headers exceed the size the server allows, either individually or collectively. The usual culprits are oversized cookies and bloated Authorization or custom headers.
Many servers cap the buffer that holds all headers (often 8-16 KB). When a session accumulates too much data into a cookie, or many third-party cookies pile up, that limit is exceeded and 431 is returned.
GET /dashboard HTTP/1.1
Host: app.example.com
Cookie: session=...<50 KB of cookies>...
Authorization: Bearer <very long token>HTTP/1.1 431 Request Header Fields Too Large
Content-Type: text/plain
One or more header fields exceed the allowed size.# Raise buffers that hold large headers/cookies (or reduce cookie size instead)
server {
large_client_header_buffers 4 32k;
}# See exactly which headers are being sent (look for bloated Cookie)
curl -v https://app.example.com/dashboard 2>&1 | grep -i '^> '