client error RFC 6585

HTTP 431 Request Header Fields Too Large

The combined size of the request headers exceeds the server limit.

What it means

Either a single header is too big or the sum of all headers is over the limit. Nginx default is 8KB, Apache is around 8KB per header field. Most often triggered by cookies that grew too large (legacy analytics libraries, tracking pixels leaving cookies from many domains).

When servers send it

  • Cookie header alone exceeds 8KB (accumulated cookies from many services)
  • Very long Authorization header (encoded JWT with many claims)
  • Custom headers accumulated by proxies

What the client does

Clears cookies for the domain. Reduces custom headers. Retries.

Common causes

  • Too many cookies on the domain
  • Bloated JWT with many custom claims
  • Chain of reverse proxies each adding X-Forwarded-* headers

How to fix it

  • 1.Clear cookies for the domain (browser dev tools)
  • 2.Shrink JWT payload (move data to server-side session instead of embedding)
  • 3.Increase nginx `large_client_header_buffers`
  • 4.Consolidate custom headers

Similar codes

← All HTTP status codes · HTTP status cheat sheet · HTTP headers reference