Error 494 "Request Header Or Cookie Too Large": what it means and how to fix it

Error 494 means your browser sent the website more header data than its server is willing to read, almost always because of too many or too-large cookies. It comes from Nginx, one of the most popular web servers, and most visitors actually see it as 400 Bad Request: Request Header Or Cookie Too Large. The site is usually fine for everyone else. Clearing that one site's cookies fixes it in under a minute. Here's why it happens, how to fix it, and what site owners can change.

Quick answer

What's going on: your browser sent the website more cookie data than its server will read. You may see it as "400 Bad Request: Request Header Or Cookie Too Large".

Can you fix it yourself? Yes. The site is usually fine for everyone else, and the fix is on your side.

The quick fix:

  1. Clear the cookies for that one site. No need to wipe your whole browser.
  2. Reload the page and sign in again if asked.
  3. Still there? Clear the cookies for the main domain too.
Diagram: the browser sends a request carrying a pile of cookies, the Nginx server's 8 KB header limit is exceeded and it replies 400 Request Header Or Cookie Too Large; fixes include clearing the site's cookies, clearing the main domain's cookies and pausing extensions
Tap the image to enlarge

What error 494 means

Every time your browser asks for a page, it sends a short note along with the request, called the request headers. They include things like your browser type, your language and, importantly, every cookie that website has stored on your device. Cookies keep you logged in, remember your basket and settings, and power analytics and ads.

Web servers set a limit on how big those headers can be, to protect themselves from abuse. Nginx's default allows each header line up to 8 KB. Because all of a site's cookies travel in a single Cookie header, a pile of cookies can push it over that limit. When that happens, Nginx stops and refuses the request.

Internally Nginx records this as status 494 Request Header Too Large. It isn't an official HTTP status code, and unless the site owner has set up a custom page for it, Nginx sends your browser a plain page that reads:

  • "400 Bad Request", with the line "Request Header Or Cookie Too Large" underneath and nginx at the bottom.

Chrome, Edge, Firefox and Safari all show the website's own page here, so the wording is the same in every browser. Some other servers and networks report the same problem with their own message or code, such as 431 Request Header Fields Too Large, the official status code for it.

Rule out the website first

Paste the address into CheckIfSiteDown. Our checker visits without any of your cookies:

  • If it shows Up, which it almost always will, the site is working and the problem is the data your browser is sending. Clear the site's cookies, as described below.
  • If it shows Down, the site has a bigger problem than your cookies, and it's worth waiting a while.

A quick test: open the site in a private or incognito window, which starts without cookies. If it loads there, cookies are definitely the cause.

Why it happens

  • Cookies building up over time. Sites with lots of tracking, testing and ad tools add more cookies with every visit, until one day they no longer fit.
  • Many sub-sites sharing one domain. Cookies set for example.com are also sent to shop.example.com, help.example.com and so on, so they add up.
  • Login problems. A login system stuck in a loop can keep adding session cookies.
  • Very long single cookies, such as large login tokens from some single sign-on systems.
  • Browser extensions or corporate proxies that add extra headers to every request.

How to fix it as a visitor

  1. Clear cookies for that site only. You don't need to wipe your whole browser.
    • Chrome and Edge: click the icon to the left of the address, choose Cookies and site data (Chrome) or Cookies (Edge), and delete the data stored for the site.
    • Firefox: click the padlock in the address bar and choose Clear cookies and site data…
    • Safari on a Mac: open Settings → Privacy → Manage Website Data, search for the site and remove it.
    • Safari on iPhone or iPad: in the Settings app, open Safari's Advanced → Website Data and swipe to delete the site.
  2. Reload the page. You may need to sign in again, but the error should be gone.
  3. Still there? Clear cookies for the parent domain too. If the error is on shop.example.com, also clear the cookies stored for example.com.
  4. Turn off extensions that change or add headers, such as privacy tools, user-agent switchers or developer add-ons, and try again.
  5. As a last resort, clear all cookies in your browser's privacy settings. You'll be signed out of most sites, so try the steps above first.

If the error returns every few days on the same site, the site itself is setting too many cookies. Let its support team know, because other visitors will be hitting it too.

For site owners: trim the cookies or raise the limit

Your Nginx error log will usually show a line such as client sent too long header line, often naming the Cookie header. You can fix it in two ways, and the first is better in the long run.

  • Send fewer, smaller cookies. Audit what your site and its scripts set. Remove old analytics and testing tags, keep sessions server-side instead of storing big tokens in cookies, and scope cookies to the subdomain that needs them rather than the whole domain.
  • Raise the Nginx limit if you need to. The setting is large_client_header_buffers, which defaults to 4 8k (four buffers of 8 KB each). A single header has to fit in one buffer, so to allow larger cookies, raise the size, for example:
    large_client_header_buffers 4 16k;
    Put it in the http or server block, test with nginx -t and reload Nginx.
  • Check every layer. If Nginx sits in front of another server or a CDN, each one has its own limit. Apache's is LimitRequestFieldSize (8,190 bytes by default), and Node.js has its own maximum header size and answers with 431. Raising one limit won't help if the next one is still lower.
  • Show a helpful page. You can catch this error with error_page 494 and show a page that tells visitors to clear your site's cookies.

An over-long address is a related problem: Nginx answers that with 414 Request-URI Too Large instead.

494 vs similar errors

ErrorWhat it means
494 / 400 "Request Header Or Cookie Too Large"Nginx refused your request because the headers, usually cookies, were too big. Clear the site's cookies.
431 Request Header Fields Too LargeThe official status code for the same problem, used by many other servers and apps.
414 URI Too LongThe web address itself was too long, often from a broken link or redirect loop.
429 Too Many RequestsNot too big, but too often. See our error 429 guide.
403 ForbiddenThe server understood your request but won't let you in. See our error 403 guide.

More codes are explained in our HTTP status codes guide.