431 HTTP Origin: Network OSI layer 7 · Application Last updated 10 Oct 2026

HTTP 431 Request Header Fields Too Large

The request headers — almost always cookies — exceed the server’s size limit.

Exact message you may see Request Header Fields Too Largeheader too large
Seen on: Node.js Nginx

Meaning

Cookies are sent with every request. When an app (or many apps on sibling subdomains) set too many or too large cookies, requests eventually exceed the limit. Node.js’ default header limit is 16 KB; Nginx usually answers 400 “Request Header Or Cookie Too Large” instead of 431.

Common causes

  • Too many / too large cookies for the domain (analytics, A/B tools, auth tokens)
  • Large JWTs stored in cookies
  • Cookies set on the parent domain shared by many subdomains
  • localhost cookies accumulated from many different dev projects

⚡ Quick fix

  1. Clear cookies for the site (or for localhost in development)
  2. Store less in cookies — keep a session ID server-side
  3. Scope cookies to the specific host/path
  4. Raise the limit (Node: --max-http-header-size) only if needed

Detailed fix by platform

Node.js

  1. Raise the header limit:
    bash
    NODE_OPTIONS=--max-http-header-size=32768 npm start

Nginx

  1. large_client_header_buffers 4 32k;

Code examples

Measure cookie size in the browser console

javascript
console.log(document.cookie.length, 'bytes of cookies (excluding HttpOnly ones)');

How to diagnose

  1. Cookies — How many cookies and how large?
  2. Scope — Which domain/path sets them?
  3. Server — What is the header limit?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

400 — HTTP 400 Bad Request (HTTP)400400 — 400 Bad Request: Request Header Or Cookie Too Large (HTTP)400413 — HTTP 413 Content Too Large (Request Entity Too Large) (HTTP)413414 — HTTP 414 URI Too Long (HTTP)414494 — nginx 494 Request Header Or Cookie Too Large (HTTP)494Cookie — Cookie is set but not sent back (Domain, Path or Secure mismatch) (HTTP)CookieCookies are blocked — WordPress login: Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. (WordPress)Cookies are blockedERR_HTTP2_PROTOCOL_ERROR — Chrome: This page isn’t working — example.com is unable to handle this request. ERR_HTTP2_PROTOCOL_ERROR (Browser)ERR_HTTP2_PROTOCOL_ER…431

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.