skip to content

questions

4

What does HTTP status 431 Request Header Fields Too Large mean, when is a server supposed to send it, and why do many real servers send 400 Bad Request in the same situation instead?

level: juniorimportance: should knowfreq 38%

basics

~20 s

431 means the request's header fields are too large — either one field or the whole set — so the server refused to process it. It is the correct code, but many servers (and proxies) reject oversized headers with 400 Bad Request or just close the connection, because the failure happens mid-parse.

open as a page

Roughly how large a request header section do common HTTP servers accept by default, which settings control it (for example nginx's large_client_header_buffers and Tomcat's maxHttpHeaderSize), and what should you weigh before raising the limit?

level: middleimportance: should knowfreq 36%

basics

~20 s

Most servers cap headers around 8 KB by default: nginx large_client_header_buffers 4 8k, Tomcat maxHttpHeaderSize 8192, Apache LimitRequestFieldSize 8190; Node.js allows 16 KB. Raise it only knowingly — the buffer is per connection, so bigger limits multiply memory and DoS exposure — and raise it on every tier.

open as a page

You are setting a request header size budget for a platform with a CDN, a load balancer, an ingress tier and dozens of services. How would you choose the number, decide what is allowed to consume it, and stop it from being exceeded again a year later?

level: principalimportance: nice to knowfreq 22%

basics

~20 s

Pick one number the whole chain honours (commonly 16–32 KB), sized from measured p99 plus proxy-added headers and checked against limit times peak concurrency for memory. Make outer tiers no more permissive than inner ones, allocate the budget explicitly, and monitor p99 against it.

open as a page