431 Request Header Fields Too Large

A 431 is the server declining to read your request because the headers arrived too big to handle. Nothing is wrong with the page you asked for or with the address you used. The problem is everything your browser attached along the way, and in practice that means cookies, quietly accumulating until one request tips past the limit.

Updated August 2026 · 6 min read

  • Written by

    Andrian Valeanu Andrian Valeanu Founder of Pulsetic

    Andrian Valeanu founded Pulsetic and, before it, Designmodo. Across 15-plus years he has shipped web products, design tools, and monitoring software teams around the world rely on.

  • Reviewed by

    Ionut Caval Ionut Caval Technical reviewer

    Ionut Caval reviews Pulsetic's technical guides for accuracy. He works hands-on with web servers, networking, and uptime monitoring day to day, and makes sure the causes and fixes here hold up in production.

The short version: Clear the cookies for that one website. Cookie bloat is the cause in the overwhelming majority of cases, and clearing them for a single domain fixes it without touching the rest of your browsing. If you run the website, raise large_client_header_buffers on nginx to stop people being locked out, then reduce what you are storing in cookies, because headers travel with every request.

Key takeaways

  • 431 Request Header Fields Too Large means the request headers were too big for the server to process, either one oversized field or all of them combined.
  • Cookies are the usual culprit, because every cookie for a domain is sent on every request, and they accumulate across applications sharing that domain.
  • nginx answers the same condition with 400 Bad Request: Request Header Or Cookie Too Large instead of 431, so the identical problem appears under two status codes.
  • For a visitor, clearing that one website's cookies fixes it almost every time, and requires nothing from the website owner.
  • Raising the server buffer stops people being locked out, but headers ride on every request, so bloated ones are a permanent cost rather than a one-off error.
Error type
HTTP 4xx client error
Whose side
Usually the request; sometimes a buffer set too low
Fix difficulty
Easy
Common cause
The request headers exceeded the server buffer

How did you find out this time?

Pulsetic is website uptime monitoring. It checks your URL from outside your network as often as every 30 seconds, confirms any failure from another region, then emails you.

10 monitors free, email alerts on failure and recovery. No credit card.

What does 431 Request Header Fields Too Large mean?

A 431 Request Header Fields Too Large means the server refused to process the request because its headers were too big. RFC 6585 defines it for two related situations: a single header field that is oversized on its own, and a set of fields whose combined size passes what the server will accept. The specification suggests the response should indicate which field was at fault, though few servers actually do, which is part of why the error is more confusing in practice than it needs to be. What matters is that nothing is wrong with the URL or the page, only with everything the browser attached to the request.

Cookies dominate the causes, because of how they work. Every cookie set for a domain is sent on every request to that domain, so they accumulate rather than replace one another. Add an SSO layer storing claims, several applications sharing the same domain, and a chain of proxies each appending forwarded headers, and an ordinary page request can carry several kilobytes of headers without anyone intending it. nginx, meanwhile, reports the same condition as 400 Bad Request: Request Header Or Cookie Too Large, so the identical problem is documented under two different status codes depending on which server answered.

YouDNSNetworkCDN / ProxyWeb serverApp / DB
The path a request takes from your browser to the website's servers. A 431 Request Header Fields Too Large is produced at the highlighted stages.
431
HTTP status code, defined in RFC 6585 alongside 428, 429 and 511
8 KB
The default header buffer on nginx, and the limit most requests run into first
4 KB
The maximum size of a single cookie in most browsers, so a handful is enough to exhaust the buffer

How the 431 Request Header Fields Too Large error appears

The wording changes depending on your browser, device, or server. Here is how this error commonly shows up:

What a 431 Request Header Fields Too Large looks like in the browser. The exact wording varies by browser, device, and server.
  • 431 Request Header Fields Too Large
  • HTTP Error 431
  • Error 431
  • 400 Bad Request: Request Header Or Cookie Too Large
  • Request Header Or Cookie Too Large
  • Header too long

431 vs 413, 414 and 400

Four codes that all appear when something about a request is too big, distinguished by which part of it.

Code What it means Who fixes it
431 Request Header Fields Too Large The headers exceeded what the server will accept, usually because of cookie bloat. The visitor, by clearing cookies, or the owner, by trimming them and raising buffers.
413 Content Too Large The request body was larger than the server accepts, typically a file upload. The owner, by raising the body limit, or the sender, by uploading less.
414 URI Too Long The URL itself was too long, usually an overgrown query string. Whoever built the URL, by moving parameters into a request body.
400 Bad Request The generic parse failure, and what nginx returns for oversized headers instead of 431. The same fixes as 431 when the message mentions headers or cookies.

Which part of the request was too large

Three status codes cover three different parts of a request, and each has its own server setting.

CodeWhat was too largeTypical fix
431 Request Header Fields Too LargeThe headers, usually cookiesClear cookies; raise header buffers
413 Content Too LargeThe request bodyRaise the body size limit; upload less
414 URI Too LongThe URL itselfMove parameters into a POST body
400 Bad RequestAny of the above, on nginxSame fixes; only the code differs

What causes 431 Request Header Fields Too Large?

  • Cookie accumulation for a domain, where every cookie is sent on every request and several applications on the same domain each add their own.
  • A large authentication token in a cookie or an Authorization header, such as a JWT carrying many claims.
  • An SSO or identity layer storing session state, group memberships, and roles in cookies rather than server-side.
  • A chain of proxies or load balancers each appending forwarded headers, which stack up and push an otherwise normal request past the limit.
  • A server buffer set lower than the default, or left at the default on an application whose headers legitimately need more room.
  • A redirect loop through an authentication flow that accumulates state parameters and cookies with each hop.
  • Development or debugging headers left enabled in production, adding size to every request without anyone noticing.

How to find the cause fast

  1. Reproduce with curl -v and read the request headers it prints. An oversized Cookie line is usually obvious immediately.
  2. Open the page in an incognito window. Working there points squarely at cookies, since incognito starts without them.
  3. Inspect the cookies for the domain in browser devtools and note their sizes and which paths they apply to.
  4. Check whether the error appears only after signing in or after a redirect chain, which points at the auth layer as the source of the bloat.
What a 431 Request Header Fields Too Large looks like from the command line. The grey lines starting with # are explanatory comments.

How 431 Request Header Fields Too Large looks from the outside

A 431 is a normal HTTP response, so from outside the server looks perfectly healthy and an up-or-down check will report it up. What makes this error particularly awkward is that it is stateful: it affects visitors who have accumulated enough cookies, and not the monitor, which arrives with none. A synthetic check will sail through while signed-in users are locked out entirely, and the people affected are your most engaged ones, since cookies accumulate with use. Checking a signed-in path, rather than only the public homepage, is what makes this class of failure visible.

To confirm the exact code a URL returns, or to re-test several at once after a fix, run them through the free bulk URL status checker.

How to fix 431 Request Header Fields Too Large

If you are a visitor

  1. Clear the cookies and site data for that specific website. This fixes the overwhelming majority of cases and does not disturb your other browsing.
  2. Try an incognito or private window, which starts with no cookies and confirms the diagnosis in seconds.
  3. Sign out and back in after clearing, so the website issues a fresh, smaller set of cookies.
  4. Disable browser extensions temporarily, particularly any that add headers or manage sessions.
  5. If it fails in incognito too, the request is not carrying your cookies and the problem is on the website's side, so report it to the owner.

If you run the website

  1. Raise large_client_header_buffers and client_header_buffer_size on nginx, then reload. This stops visitors being locked out while you address the cause.
  2. Audit what you are storing in cookies. Keep an identifier and hold the state server-side, which is the only fix that survives the application growing.
  3. Scope cookies to the paths and subdomains that need them, so one application does not lock visitors out of every other service on the domain.
  4. Check your proxy chain for accumulated forwarded headers, and strip the ones nothing downstream reads.
  5. Set sensible expiry on cookies so stale ones are discarded rather than accumulating indefinitely.
  6. Return a helpful message rather than a bare status. A 431 that tells the visitor to clear their cookies resolves itself; one that does not becomes a support ticket.

Still not fixed? Next steps

  • Measure the actual header size with curl -v rather than guessing. A Cookie line running to several kilobytes is usually visible at a glance.
  • Identify which cookies are large and which application set them. On a shared domain, one service can lock visitors out of all the others.
  • Raise large_client_header_buffers and client_header_buffer_size on nginx as an immediate measure, then reduce what is being stored.
  • Check whether a proxy, SSO layer, or gateway is adding headers of its own, since forwarded headers stack up through a chain and can push a normal request over the limit.
  • Move session state server-side and keep only an identifier in the cookie. This is the only fix that stops the problem returning as the application grows.

Code & configuration

Copy-paste starting points. Replace example.com and the paths with your own, and test changes on staging before production.

Raise the nginx header buffers

# in the http block, then reload nginx
http {
  client_header_buffer_size   4k;
  large_client_header_buffers 4 16k;
}
# the default is 8k; this is relief, not a cure

See how big the request headers actually are

curl -v https://example.com 2>&1 | awk '/^> /{n += length($0)} END{print n " bytes of request headers"}'
# then look at the Cookie line specifically
curl -v https://example.com 2>&1 | grep -i '^> cookie' | wc -c

Keep an identifier in the cookie, not the state

// bloats every request, forever
setcookie("profile", json_encode($fullUserObject));

// one small identifier; the data lives server-side
setcookie("sid", $sessionId, ["httponly" => true, "samesite" => "Lax"]);

How to prevent 431 Request Header Fields Too Large

A 431 is stateful in a way that defeats ordinary checks: it strikes visitors who have accumulated enough cookies, and never the monitor, which arrives with none. So a synthetic check passes happily while your most engaged signed-in users are locked out completely, and the first sign is a support ticket. Pulsetic checks your website and endpoints from multiple locations every 30 seconds and alerts you by email, SMS, voice call, Slack, Discord, Telegram, or webhook when a URL stops returning the status code you expect, so a path that starts refusing real sessions does not stay invisible.

Learn how Pulsetic's uptime monitoring detects this from the outside, across 15+ locations.

Sources and further reading

The specifications and vendor documentation this guide is written from, plus deeper reading on the parts it only summarises.

Frequently asked questions

  • What does 431 Request Header Fields Too Large mean?

    It means the server refused the request because its headers were too big, either one oversized field or all of them combined. Nothing is wrong with the page or the address; the problem is what the browser attached to the request. Cookies are the usual reason, because every cookie set for a domain is sent on every request to it, so they accumulate until one request finally exceeds the limit.

  • How do I fix a 431 error as a visitor?

    Clear the cookies and site data for that specific website, which resolves it in almost every case and leaves the rest of your browsing untouched. Testing in an incognito window first is a quick way to confirm the diagnosis, since incognito starts with no cookies. After clearing, sign in again and the website will issue a fresh, much smaller set.

  • Why does nginx show a 400 instead of a 431?

    Because nginx answers oversized headers with 400 Bad Request: Request Header Or Cookie Too Large rather than using 431. The condition and the fix are identical; only the reported status differs. It is worth knowing when searching for help, because the same underlying problem is documented under two different codes depending on which server you happen to be talking to.

  • What is the difference between 431, 413 and 414?

    They cover different parts of the request. A 431 is about the headers, a 413 about the body, and a 414 about the URI. A large file upload produces 413, an overgrown query string produces 414, and cookie bloat produces 431. Because each maps to a different server setting, identifying which one you actually have is the first step to fixing it.

  • Why did this start after logging in?

    Because signing in is when cookies are set. SSO and identity systems often store session tokens, role claims, and state parameters in cookies, and an authentication redirect chain accumulates them with each hop. If several applications share the domain, each adds its own. That is why the error so often appears immediately after a login rather than on a first visit.

  • Should I just raise the server buffer?

    Raise it to stop visitors being locked out, but do not treat it as the fix. Headers are sent with every single request, so bloated ones are a permanent cost on every page load rather than the cause of a single error. The durable answer is to store an identifier in the cookie and keep the state server-side, which stops the problem returning as the application grows.

  • Can a proxy cause a 431?

    Yes. Reverse proxies, load balancers, and gateways add forwarded headers as a request passes through them, and a chain of several can add enough that a request which was comfortably within limits at the client arrives oversized at the origin. Stripping forwarded headers that nothing downstream actually reads is worth doing for its own sake, and it removes this as a cause.

  • Why do I see 400 instead of 431 for the same problem?

    Because nginx, which serves a large share of the web, answers oversized headers with 400 Bad Request: Request Header Or Cookie Too Large rather than with 431. The condition is identical and so is the fix; only the status code differs. That is worth knowing when searching for a solution, since the same underlying problem is documented under two different codes depending on which server you happen to be talking to.

  • Is it one big header or all of them together?

    It can be either, and RFC 6585 deliberately allows both readings. A server may reject the request because a single field is oversized, typically a very long Cookie or Authorization value, or because the headers add up past the total buffer even though none is individually unreasonable. The specification recommends indicating which field was at fault, though in practice few servers do, which is why clearing cookies is such a common first move.

  • Why does an SSO login cause this?

    Because SSO and identity systems tend to store a great deal in cookies, and every one of them is sent on every request. Session tokens, group and role claims, and state parameters accumulate quickly, and with several applications on the same domain each adding its own, the combined Cookie header can pass the default 8 KB buffer. It typically appears after a redirect chain, which is when the collection is at its largest.

  • How is this different from 413 or 414?

    All three are about size, but of different parts of the request. A 431 is the headers, a 413 is the body, and a 414 is the URI. They fail in different places and are fixed with different settings, so identifying which one you actually have matters. A large file upload is 413, a very long query string is 414, and a mountain of cookies is 431 or, on nginx, a 400 saying the same thing.

  • Can raising the server buffer fix it permanently?

    It buys room, but it treats the symptom. Headers travel with every single request, so bloated ones are a permanent tax on every page load, not just a cause of one error. Raising large_client_header_buffers is the right immediate action to stop visitors being locked out, and reducing what you put in cookies is what actually solves it. Storing an identifier and keeping the state server-side is the usual answer.

Trusted by teams at companies around the world