При переходе на какой-либо сайт, или выборе какого-либо из подразделов сайта, пользователь может столкнуться с сообщением «Request Header Or Cookie Too Large», при этом дальнейший переход по выбранной ссылке становится невозможен. Обычно это связано с повреждёнными куками данного сайта на пользовательском ПК, но также возможна ситуация, когда в появлении проблемы виноваты некорректные настройки данного ресурса, установленные веб-мастером.

Также может возникать ошибка 404 описанная нами ранее.
Содержание
- Что это за ошибка и каковы и её причины
- Как исправить 400 Bad Request
- Заключение
Что это за ошибка и каковы и её причины
Перевод текста ошибки выглядит как «Заголовок запроса или куки слишком большие». Обычно это обозначает ситуацию, когда при запросе браузером доступа к какому-либо ресурсу сервер обнаруживает, что куки данного ресурса, хранящиеся на пользовательском ПК, слишком большие или повреждены. Сервер отказывает в обработке запроса, что сопровождается сообщением «400 bad request» («400 неверный запрос»), а также упомянутым мной месседжем.
Данная ошибка является типичной для серверов nginx (т.е. серверов, работающих на подобных к Unix операционных системах). После её появления доступ к запрошенному сайту (или его подразделу) становится невозможен, перезагрузка же проблемной страницы через Ctrl+F5 обычно ничего не даёт.
Кроме повреждённых куков, причиной появления данной дисфункции могут быть следующие детерминанты:
- Различные браузерные расширения и плагины, блокирующие корректный доступ к нужному сайту;
- Корректный доступ к кукам блокирует антивирус (приложение безопасности);
- Куки браузера повреждены какой-либо вирусной программой;
- Неверные настройки (проблемы в работе) запрошенного веб-сайта.

Как исправить 400 Bad Request
При попытке избавиться от возникшей проблемы важно учитывать, что проблема может быть как у вас (если вы обычный пользователь), так и на самом ресурсе. Потому если вы использовали все нижеприведённые советы для пользователя, и ничего не помогло, тогда, возможно, стоит обратиться с письмом в техническую поддержку ресурса (или непосредственно веб-мастеру), и обрисовать возникшую проблему.
Для решения проблемы «Cookie Too Large» следует выполнить следующее:
- Полностью закройте, а потом вновь откройте ваш браузер. Несмотря на простоту данного совета, в некоторых случаях он оказывается довольно эффективным;
- Временно отключите ваши антивирус и брандмауэр, дабы убедиться, что они не являются виновниками возникшей проблемы;
- Проверьте ваш компьютер на наличие вирусных программ. Помогут специализированные инструменты уровня «Dr. Web CureIt!», «AdwCleaner» и другие аналоги;

Проверьте ваш компьютер с помощью Dr.Web CureIt! - Отключите все лишние расширения (дополнения) для вашего браузера, чтобы убедиться, что они не являются катализаторами появления ошибки;
- Очистите кэш и куки вашего браузера. Вы можете удалить куки как для данного сайта, так и все куки вашего браузера. Например, в Мозилле это делается переходом в настройки браузера – «Приватность и защита» — «Показать куки» – «Удалить выбранные» (для отдельного сайта) или «Удалить все» (для всех). Также нажмите на «Очистить сейчас» рядом с опцией «Кэшированное веб-содержимое» для очистки кэша;
- Очистите журнал истории для проблемного сайта. Например, в Мозилле это делается переходом в «Настройки» – «Журнал» – «Показать весь журнал». В списке найдите нужный вам сайт, выберите его, кликните правой клавишей мыши, и в появившемся меню нажмите на «Забыть об этом сайте»;

- Используйте другой браузер для перехода на нужный сайт;
- В случае, если вы веб-мастер, и проблема наблюдается на вашем ресурсе, попробуйте увеличить параметр «large_client_header_buffers» в nginx.
Это реализуется следующей записью:

Заключение
Решением данной проблемы Request Header Or Cookie Too Large со стороны пользователя является удаление куков проблемного сайта на компьютере пользователя. А со стороны администрации ресурса эффективным способом решения проблемы станет изменение параметра «large_client_header_buffers» в nginx. В большинстве случаев реализация данных советов помогает избавиться от возникшей ошибки, возобновив полноценную работу с сайтом на вашем ПК.
Опубликовано 03 ноября 2017 Обновлено 01 октября 2020
Ошибка 400 Request Header Or Cookie Too Large в веб-сервере Nginx встречается достаточно редко. Данная ошибка означает, что отправленный запрос к веб-серверу слишком большой и был отклонен. Это может происходить по разным причинам.
Например, такое бывает, когда идет переход к веб-сайту из поисковой системы, и какой-то заголовок оказался слишком длинным. В этом случае Nginx «не ожидал» такого большого объёма в заголовке и сбросил соединение. В этой статье будет рассмотрено описание данной ошибки и как ее можно исправить.
Ошибка 400 Request Header Or Cookie Too Large воспроизводится, когда размер заголовков HTTP/HTTPS запроса больше допустимого предела. Например, браузер отправляет слишком много Cookie файлов или отправленный запрос к веб-серверу имеет слишком большой размер.
Запрос принято разделять на две части: заголовки — где находится общая информация и мета данные, и тело запроса. Тело запроса, как и заголовок может быть разного размера — как маленьким, так и большим и его размер как правило не вызывает никаких проблем. Однако если в настройках веб-сервера задан параметр на ограничение длины заголовка запроса, то есть вероятность получить данную ошибку. Скриншот с ошибкой изображён ниже:

Как исправить ошибку Request header or cookie too large в Nginx
Для исправления данной ошибки (если вы администратор веб-сервера Nginx) необходимо увеличить максимальный размер заголовка при помощи изменения параметра large_client_header_buffers. Если же вы обычный пользователь веб-сайта, на котором возникла данная ошибка то необходимо дождаться пока ошибку исправит администратор ресурса.
Для исправления данной ошибки со стороны веб-сервера Nginx необходимо подкорректировать параметр large_client_header_buffers. Данный параметр принимает 2 числа, например 4 и 8 (которые заданы по умолчанию). Первое число — значение, которое задаёт максимальное число буферов, а второе число отвечает за размер буфера, в который считывается заголовок запроса. В второй параметр задаётся в килобайтах.
Данную строку необходимо добавить в секцию http конфигурационного файла конфигурационного файла Nginx или в секцию server для определённого сайта. Конфигурационные файлы веб-сайтов в Nginx обычно хранятся в /etc/nginx/conf.d/ или в /etc/nginx/sites-available/ (в зависимости каким образом был установлен Nginx — при помощи стандартных репозиториев операционной системы или при помощи репозитория Nginx).
Для корректировки значения можно задать числа 8 и 64 подходящие для хранения больших заголовков. В итоге параметр будет выглядеть следующим образом:
large_client_header_buffers 8 64k;

После того как были внесены изменения в конфигурационный файл необходимо перезапустить Nginx при помощи команды:
sudo systemctl reload nginx
Выводы
В этой небольшой статье была рассмотрена ошибка 400 Request Header Or Cookie Too Large Nginx. Если у вас есть доступ к серверу, на котором расположен сайт, на котором возникает данная ошибка, то вы можете исправить ее за несколько минут. Если у вас остались вопросы, спрашивайте в комментариях!

Статья распространяется под лицензией Creative Commons ShareAlike 4.0 при копировании материала ссылка на источник обязательна .
Об авторе
I am getting a 400 Bad Request request header or cookie too large from nginx with my Rails app. Restarting the browser fixes the issue. I am only storing a string id in my cookie so it should be tiny.
Where can I find the nginx error logs? I looked at nano /opt/nginx/logs/error.log, but it doesn’t have anything related.
I tried to set following and no luck:
location / {
large_client_header_buffers 4 32k;
proxy_buffer_size 32k;
}
nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /home/app/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19;
passenger_ruby /home/app/.rvm/wrappers/ruby-1.9.3-p392/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 20M;
server {
listen 80;
server_name localhost;
root /home/app/myapp/current/public;
passenger_enabled on;
#charset koi8-r;
#access_log logs/host.access.log main;
# location / {
# large_client_header_buffers 4 32k;
# proxy_buffer_size 32k;
# }
# location / {
# root html;
# index index.html index.htm;
# client_max_body_size 4M;
# client_body_buffer_size 128k;
# }
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ .php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ .php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
Here’s my code storing the cookies and a screenshot of the cookies in Firebug. I used firebug to check stored session and I found New Relic and jQuery are storing cookies too; could this be why the cookie size is exceeded?

def current_company
return if current_user.nil?
session[:current_company_id] = current_user.companies.first.id if session[:current_company_id].blank?
@current_company ||= Company.find(session[:current_company_id])
end
If you are getting the Error 400 Bad Request: Request Header or Cookie too Large Issue issue while trying to access a website or even your own website, we are here to help you. In this article, we have compiled different solutions and workarounds that will help you completely rid yourself of this error.

Make sure to follow all the solutions that have been listed in this article and also read through the reasons due to which it occurs in the first place. Basically, some Nginx web servers are set up in such a way that they might not accept cookies that are greater than a certain size.
What Causes the 400 Bad Request Request Header or Cookie too Large Error?
After going through the mentioned solutions that the users have told us, we have concluded the reasons due to which the error might be triggered.
- Large Cookies: Sometimes, the cookies that you are trying to use with the website might be too large due to which the Bad Request Header or Cookie too large error might be triggered. Therefore, we suggest that you try and clear out the cookies in an attempt to fix the issue.
- DNS Cache: The DNS settings that you have configured with your computer might be preventing it from being able to connect with certain websites or the DNS cache stored might have been corrupted. Therefore, we suggest that you try and flush out the DNS cache.
- File Size: The File Size that you are trying to upload might be larger than the upload limit of the website. Therefore, we suggest that you try and reduce the file size or try to upload a different file with a size smaller than the one that you are trying to upload.
- Chrome Extensions: The extensions installed on your browser might be preventing the site from being accessed due to which the error is being triggered. Therefore, we suggest that you try and disable the extensions and then check to see if doing so fixes the error message.
Now that the reasons have been mentioned to you, you can finally start implementing the solutions and hopefully get rid of the error message on your PC.
Fixing the Bad Request Header or Cookie too Large Error:
Solution 1: Clear Cookies
This error can be instantly resolved by clearing cookies from your browser. Proceed with the steps listed below for clearing the cache in your respective browser:
Google Chrome:
- Launch Google Chrome and select the “Three Dots” on the top right side of the window.
- From the dropdown menu that appears, click on the “Settings” option.
- In the search bar type in “Site Settings” and open it.

Clicking on “Site Settings” - Navigate to “Content” and click on “Cookies and Site Data”.
- Afterwards, click on the “See all cookies and sites” option.
- Then click on “Remove All” to remove all of the cookies.

Clicking on the “Remove All” button - Finally, proceed to “Restart” the Chrome browser.
Firefox:
- Open Firefox on your desktop PC and click on the “Open Application Menu” option in the top-right corner.
- From here select “Options” from the drop-down menu and next click on “Privacy & Security” from the right window pane.

Clicking on “Options” in Firefox - Next under the “History” section click on the “Clear History” option.
- Lastly “Restart” Firefox and check to see if the error got solved.
Microsoft Edge:
- Open Microsoft Edge on your PC and click on the “Three Dots” in the upper right corner of the window.
- Click on the “Settings” option on the top right side and from the left, select the “Privacy, Search, and Services” option.
- On the Right, select the “Choose what to clear” option and select it.
- Check the “Cookies and saved website data” option and next click on “Clear”.

Clearing Microsoft Edge Cookies - Lastly, “Restart” the browser and check to see if the error got fixed.
Opera:
- Click on the “Opera” icon in the upper left corner of the window.
- Select the “Preferences” from the drop-down menu.
- Then select “Privacy and Security” and navigate to “Cookies”.

Clicking on the Privacy and Security option - Go to “All cookies and website data” and delete all cookies by clicking the “Delete All” option.
- Finally, “Restart” the browser.
Safari:
- Click on the “Safari” icon on the top left-hand corner of the window.
- From the dropdown menu, navigate to “Preferences” and click on it.
- Select the “Privacy” tab and click on “Remove all website data” in cookies to delete all cookies.

Selecting the Remove all Website Data option - Then “Restart” your browser.
Solution 2: Add Base URL to Clear Cookies
- Open “Google Chrome” and click on three vertical dots on the top right corner of the window.
- A dropdown menu will appear up, from here click on “Settings”.
- In the search bar type “Site Settings” and click to open it.

Selecting the “Site Settings” option - Click on the “Cookies and Site Data” option and scroll to the bottom.
- Click on “Add” which is next to the “Always Clear Cookies when Windows are Closed” option.

Clicking on the “Add” option - Enter the base “Web Address”, e.g. youtube.com. (A base address is one that is without any path or an address that leads you to the front page of the website).
- Finally, click on “Add”.
Solution 3: Verify the Entered URL
Sometimes the URL you type is also wrong. A few common mistakes are misspelling the site name or entering the backward slashes. One easier way is to use the URL shortener if you have a long URL and try to copy-paste the URL instead of typing it manually to avoid any mistake. Once you have cross-checked your URL, try to access the page again. If you are still getting the error then try other methods like clearing cookies or disabling extensions.
Solution 4: Flush the DNS Cache
- Go to the “Start menu” and type “cmd” in the search bar. From the search results right-click on it and select “Run As Administrator”.

Select Run As Administrator From The Command Prompt - Then type in the following command in the Command Prompt window and hit the “Enter” key:
ipconfig /flushdns

Flush DNS - After executing this command now “Restart” your computer and run Steam again.
Solution 5: Compress the File Size
If you try to upload a file that is larger than the server limit, it is quite likely that you can face this error. You can check this by uploading a smaller file and if it uploads successfully then you might have to compress your file to avoid server limitation issues.
Solution 6: Wait Until the Server Is Being Fixed
This error can also occur due to server-side issues which are out of your control. It might be a server glitch or the server might be being updated. In such a scenario all you can do is to refresh the page and wait till servers are up again. Just refresh the page on a regular interval and check if the server has been fixed and the Header or Cookie too Large error is gone or not.
Solution 7: Disable Chrome Extensions
- Launch “Chrome” on your PC, and then click on the “Three vertical dots” in the top right of the window.
- From the drop-down menu click to select the “More Tools” option.

More Tools - Next click to select “Extensions” from the extended menu.
- Once inside the Extensions tab “Disable” all of the extensions one by one, if successful in removing the error you can try enabling the extensions one by one afterwards to find out the problematic one.
- Add the “large_client_header_buffers 4 16k” directive to the “HTTP” section of “/etc/nginx.conf file”.
- Then reload the Nginx process by entering the following command:
sudo nginx -t && sudo service nginx reload
- If this doesn’t work then double the value of the second parameter of the “large_client_header_buffers” directive and reload Nginx.
- Check to see if doing so fixes the Header or Cookie too Large error.
Solution 9: Use Direct Connection Mode With TCP
Convert the application to use the “Direct connection mode” with the Transmission Control Protocol or TCP. After doing this the issue would not arise because this direct connection mode with the TCP does not have a header size restriction like the HTTP protocol. Use the latest version of SDK that has a fix for query operations when the service interop isn’t available. You can learn more about it in .NET v3 or .NET v2 performance tips articles.
If you can’t go for the direct connection with the TCP then change the client consistency level to lighten the problem. The session token is only used for session consistency, other consistency levels do not use the session token.
Implement the above-indexed methods carefully in order to avoid getting the Header or Cookie too Large error in the future but if you still have any more questions in this regard then feel free to Contact Us here.
Jan 12, 2023
Leonardus N.
9min Read
The 400 bad request error is an HTTP status code that describes an error caused by an invalid request. Thus, the server can’t understand and process it. Most HTTP error 400 bad requests are caused by malformed request syntax, invalid request message framing, or deceptive request routing.
If you’re browsing the internet and encounter this error, it’s possible to solve the problem easily. However, there are several occasions when the error comes from the website server. In this case, only the site owner can fix the problem.

This article will discuss eight methods of resolving a 400 bad request error. We will also cover the HTTP error 400 bad request message variations and their possible causes.
| Error code | 400 Bad Request Error |
| Error type | Client-side |
| Error variations | HTTP Error 400 HTTP Error 400 – Bad Request HTTP Error 400. The request hostname is invalid HTTP Status 400 – Bad Request 400 Bad Request 400 – Bad Request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications. 400 Bad Request. Request Header Or Cookie Too Large Bad Request – Invalid URL Bad Request – Error 400 Bad Request – Your browser sent a request that this server could not understand |
| Error causes | Bad URL syntax File too big Bad cookies or cache DNS issues |
Variations of the 400 Bad Request Error
As an HTTP status code, the 400 bad request error informs users why they can’t access a web page. That said, the error message may vary or not show the error code itself.
Here are some variations of the 400 bad request error message you may encounter:
- HTTP Error 400
- HTTP Error 400 – Bad Request
- HTTP Error 400. The request hostname is invalid
- 400 Bad Request
- 400 – Bad Request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
- 400 Bad Request – Request Header Or Cookie Too Large
- Bad Request – Invalid URL
- Bad Request – Error 400
- Bad Request – Your browser sent a request that this server could not understand
“400 Bad Request Error” on Different Browsers
Just like a 404 error page, the 400 bad request page is customizable. For example, Google has a custom 400 bad request error page that looks the same on all web browsers.

However, if the site doesn’t have a customized error page, the web browser will show the default one. Here is how the HTTP 400 bad request status code looks on different browsers:
Google Chrome
For 400 bad request, Chrome will show an error icon with The page isn’t working text followed by If the problem continues, contact the site owner. Then, you’ll find the HTTP ERROR 400 at the bottom of the message.

Microsoft Edge
Microsoft Edge has a design almost identical to Google Chrome’s, with the HTTP ERROR 400 text at the bottom.

Opera
The HTTP 400 bad request error in Opera displays the same text as Google Chrome. The only difference is the icon, as Opera uses its logo.

Mozilla Firefox
Mozilla Firefox will show a blank page when you try to access a website using the wrong syntax. There’s no text indicating that you encountered an HTTP 400 bad request error, which makes identifying the problem harder.

Safari
Like Mozilla Firefox, the browser will appear blank with no indication of the HTTP 400 bad request error.

Causes of the 400 Bad Request Error
When you try to access a website, your computer sends a request to the web server. Then, the server processes the request and sends back the page you want.
The error 400 bad request happens when the server can’t understand the request. Thus, it won’t process it and will send you the error code instead.
In most cases, client-side issues trigger the error. Some common causes of the 400 bad request error are:
- Malformed URL syntax – the URL may contain invalid characters such as {, }, [, or ]. A wrongly encoded URL can also contain wrongly used ASCII characters, such as double percentage characters.
- Large file size – websites have a file upload limit. An attempt to upload a file that exceeds this limit can be considered a bad request and trigger the HTTP 400 error status code.
- Corrupted browser cookies or cache – expired cookies or corrupted browser cache may interfere with the request and trigger the error. This commonly happens on login pages such as the WordPress login page.
- Bad DNS cache – if the website has moved to a new domain name or web host, the DNS cache data in your operating system may be invalid.
How to Fix a 400 Bad Request Error
The first action we recommend is refreshing the page. If that doesn’t work, then you should try the following methods.
1. Double Check the Domain Address
One of the most common causes of HTTP status 400 bad request error is a wrong URL. This may include a mistyped URL, malformed syntax, and illegal characters in the URL.
It’s easy to mistype a URL, so be sure to check the domain name spelling. If the URL contains a directory path, file name, or query string, pay attention to special symbols such as a hyphen (-) or percentage character (%).
For example, www.hostinger.com/tutorials is the correct domain name. If you type in www.hostinger.com/%tutorials in the URL bar with an extra percentage character, it will result in a 400 bad request error.

A badly encoded URL can also cause this error. URL encoding converts characters into ASCII characters to make them transferable on the internet. For example, one of the most common encodings is replacing space with %20.
However, a URL can be encoded incorrectly and thus contain incorrect syntax, like double percentage characters (%%). If you enter a URL or click on a link that’s badly encoded, you’ll end up with a bad request error 400.
When encountering a 400 bad request error because of a wrong URL, use an encoder/decoder tool. Decode the URL and encode it again to make sure it is correct.
2. Search the Keyword
There may be cases where you are sure that the URL is correct, yet the error persists. If you know the title of the article or page you’re looking for, search the keywords on the website or a search engine. Sometimes you can even see the title on the URL.
For example, in the /tutorials/how-to-make-a-website URL, you’ll see the article’s title at the end of the URL. If the website has a search feature, type the keyword to find the article.
Alternatively, use a search engine like Google or Bing. To perform a search on a specific site, type site: followed by the website’s URL and the keyword.
For example, the title of the article is how to make a website. Therefore, you type site:hostinger.com how to make a website.

3. Clear Browser Cache or Cookies
Browser cookies and cache store site data and content on the client’s side to improve the browsing experience.
The browser cache contains website files such as texts and images to reduce requests to the web server and make the page load faster. At the same time, cookies store the user’s session history and preferences to make personalized browsing possible.
However, cookies may expire after some time. Also, both the website cookies and cache can be corrupted and cause a 400 bad request error.
Additionally, HTTP status 400 bad request error can happen when the web browser sends cookie data that’s too large. In this case, the error message appears as 400 Bad Request – Request Header Or Cookie Too Large.
Try clearing your browser cache and cookies to solve this problem. If you’re using Google Chrome, here are the steps to do it:
- Click on the three dots on the top right corner of Google Chrome and select Settings.

- Find the Privacy and security section and click on Clear browsing data.

- On the Clear browsing data window, check the Cached images and files and Cookies and other site data and use the drop-down menu to select the time frame.

- Click Clear data and restart Google Chrome to finish the process.
Remember that clearing the browser cache and cookies resets the settings and signs you out of websites you’ve visited. Also, it will take more time to load the websites since the browser will need to retrieve the content previously stored in the cache.
If the cache and cookies were causing the 400 bad request error, you should be able to visit the website normally again. However, if it doesn’t work, try the next method.
4. Turn Off Browser Extensions
Browser extensions can also cause a bad request error 400. That’s because these extensions interfere with the request sent to the web server, which may lead the web server to interpret the request as invalid.
Moreover, browser extensions may affect cookies, which leads to a 400 bad request error. To find out if a browser extension is causing the problem, we recommend disabling all extensions first. Here are the steps for Google Chrome:
- Click on the three dots on the top right corner of Google Chrome. Select More tools -> Extensions.

- Turn off all extensions individually by clicking on the switch button.

- Refresh the web page. If it loads normally, one of the extensions is causing the 400 bad request error.
After establishing that one of the extensions triggered the error, you need to identify the exact extension. Turn on the extensions one by one, refreshing the web page each time.
If you encounter a 400 bad request error after turning on one of the extensions, you’ve found the one causing the error. Keep the extension disabled or remove it altogether by clicking the Remove button on the extension settings page.
5. Check the File Size
Trying to upload a file that exceeds the server file size limit might trigger an HTTP status 400 bad request error. Sites usually have a different file upload limit, so check if the file you want to upload fits the limit.
If the website doesn’t mention the file limit, upload a small file to check whether that’s causing the error. If it works, then you should resize the file you originally wanted to upload.
Keep in mind that file compression may negatively affect its quality. If it’s a PDF or image, it can make the content blurry and unreadable. Be sure to check the quality of the file after compression and make sure that it’s still acceptable.
There are many free online compression tools so that you don’t need to install additional software on your computer. Some of the great examples are HiPDF for PDF files and UniConverter for video and audio files.

6. Flush DNS Cache
When you visit a site for the first time, the system goes through a DNS lookup, which searches for the nameservers and IP addresses that are associated with the domain name.
Your operating system then stores the IP addresses of the web servers in the DNS cache. Therefore, the system can reduce the DNS lookup process on the next visit, making the site load faster.
However, a corrupted or outdated DNS cache can trigger the HTTP error 400 bad request. In this case, you need to flush the DNS cache.
Since the DNS cache is stored in the operating system, the methods to flush it may vary. If you use Google Chrome, you’ll also have to flush the DNS cache in the web browser.
Here are the steps to do it on Windows and Mac OS:
Microsoft Windows 10
- Right-click on the Windows Start Menu and select Search or use the search box in the taskbar if enabled.

- Type command prompt and select the Command Prompt application.

- Type ipconfig /flushdns and press Enter.

- You’ll see the Successfully flushed the DNS Resolver Cache message after the process is completed.

macOS X
Press the F4 key to open Launchpad and enter Terminal to open the command terminal. Run the following command if you use macOS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion:
sudo killall -HUP mDNSResponder.
Google Chrome
- Type chrome://net-internals/#dns on Google Chrome’s address bar and press Enter:
- Click Clear host cache.

If you use a different operating system, make sure to check our comprehensive guide on how to flush DNS cache.
7. Contact the Site Owner to Report the Error
If all attempts to fix the 400 bad request error didn’t work, there’s a possibility that the problem isn’t a client error but rather is a misconfiguration that the web owner needs to fix.
In this case, try to visit the contact page of the website and fill a contact us form, if available. Otherwise, most sites also have contact email addresses and social network accounts where you can inform them about the 400 bad request error.
8. Restart Your PC and Other Hardware
The last method is to restart your computer and network connection hardware, such as router and modems.
Restarting a PC often solves various problems, including the 400 bad request error because it clears the Random Access Memory (RAM). Moreover, it flushes the temporary cache that’s created as you open and close programs.
Temporary data from background processes may interfere with the request sent to the server, causing the 400 bad request error.
Conclusion
The HTTP status 400 – bad request indicates that the request sent to the server is invalid or corrupted. Just like other 4xx status codes, a 400 bad request is a client-side issue.
It can be caused by malformed request syntax, invalid request message framing, or deceptive request routing.
Since this is a client-side problem, users can easily resolve most of the 400 bad request errors. To recap, here are eight methods to resolve the error:
- Double-check the domain address.
- Search the keyword.
- Clear browser cache and cookies.
- Turn off browser extensions.
- Check and reduce the file size.
- Flush the operating system’s DNS cache.
- Report the error to the site owner.
- Restart the PC and networking equipment such as the router and modem.
If you have other tips or solutions, feel free to leave us a comment below.
Leo is a WordPress fanatic and contributor. He likes keeping up with the latest WordPress news and updates, and sharing his knowledge to help people build successful websites. When he’s not working, he contributes to WordPress documentation team and pampers his dogs.
We open many websites at one time on our browser to search for something on the internet. There are some websites that we check daily; it can be a news site, your work login, or something else. If such important websites show errors like ‘400 Bad Request, Request Header or Cookie Too Large,’ it can get frustrating.
At times, you will see the same error on all the different browsers available on your computer for a specific website only. Let’s get started on what this error is and how to eliminate it to enjoy browsing again.
The ‘request header too large’ error message can be seen on any website for two main reasons. One reason is that the size of the cookie for that particular domain is too large, and therefore the server refuses to display the website. Another reason for the ‘400 Bad Request, Request Header or Cookie Too Large’ error message is corrupted cookies.
Well, you can experience this error on Google Chrome, Microsoft Edge, Mozilla Firefox, or any other browser. This error happens mostly on the sites that are running on the Nginx server.
How To Fix Request Header Or Cookie Too Large Error
You can clear cookies and cache for that particular website to fix this 400 bad request error on your browser.
Note: The solutions are suggested with regard to different famous browsers. You can jump to the web browser section you are currently using and understand how to fix request header or cookie too large.
Google Chrome
There are two ways to reach the cookie settings. You can open the new tab in the browser and type –
chrome://settings/cookies
If you don’t want to go the direct way, follow steps 1 to 3 below. You need to follow instructions from step 4, irrespective of what way you choose to reach the cookie settings page.
Step 1: Open Google Chrome browser and click on the 3 dots in the upper right corner of the browser window. Select Settings from the menu.

Step 2: In the Settings tab, scroll down to Privacy and security and click on the arrow next to Site Settings.

Step 3: Now, click on Cookies and site data under the Content section.

Step 4: Click on the arrow next to See all cookies and site data on the next screen.

Step 5: You can either delete all the cookies by clicking on the Remove All option or delete the cookie of the affected website by clicking on the delete icon next to it.
If you don’t find the problematic web page easily, you can search for it in the search bar.

Once the cookies are deleted, you can relaunch the browser. In the browser, check if you can access the website giving ‘400 Bad Request, Request Header or Cookie Too Large’ errors or not.
Microsoft Edge
Microsoft Edge does not allow you to clear cookies for a single website. You need to clear cookies and site data for all the websites. There is a timestamp option available which allows you to remove browser cookies for a specific time frame.
Open the Microsoft Edge browser and click on the 3 dots in the top right corner of the browser. Click on the Settings from the menu.
In the Settings tab, click on Privacy, search, and services from the left tab.
Next, scroll down to the Clear browsing data section and click on the Choose what to clear button.

Select the Time range; if you wish to avoid deleting all cookies, select the Last hour option. Also, check the checkbox next to Cookies and other site data.
Click on the Clear now button.

Close the Microsoft Edge browser and open it again. Once opened, try accessing the website that was giving an error. If corrupted cookies were a problem, you would be able to access the website again on the browser without a request header or cookie too large error message.
Mozilla Firefox
If you are Mozilla Firefox, you can get rid of cookies from a problematic website easily.
Step 1: Open the Mozilla Firefox browser on your computer and click on 3 lines in the upper right corner. Select Settings from the menu.
Step 2: From the Settings tab, click on Privacy & Security.

Step 3: Now, scroll down to Cookies and Site Data and click on the Manage Data option.

Step 4: In Manage Cookies and Site Data window, select the website that was giving 400 Bad Request, Request Header or Cookie Too Large error, and click on Remove Selected.

Make sure you don’t click on Remove All; it will remove cookies and cache from all websites you have browsed.
Opera Browser
If you are a fan of Opera browser, you would like to know how to get rid of the Request Header or Cookie Too Large error in Opera.
Launch the Opera browser and Easy setup option (3 lines) in the top right corner. Click on Go to full browser settings seen at the end of the menu.
Next, expand the Advanced section and click on Privacy & security.

Now, open the Site Settings

In the Site Settings, click on the arrow next to the Cookies and site data under Content.

Scroll down and click on See all cookies and site data

Click on the delete icon next to the website that was showing the 400 Bad Request error. You can search for that website in the search box if you don’t find it easily.

You can relaunch the browser and try opening the website again.
Internet Explorer
Although Internet Explorer is not used much nowadays, some people rely on it for work purposes. Know how to clear cookies and get rid of the 400 Bad Request, Request Header or Cookie Too Large error message.
Open Internet Explorer and click on the Settings gear in the top right corner of the browser. Select Internet options from the Settings menu.

In the Internet options dialog box, click on the General tab and then click on the Settings button under Browsing history.

Now, under the Temporary Internet Files tab, click on the View files button.

The File Explorer window will open, and you will see files with the website name. You can delete the file that has the affected website name. Make sure you press the Shift + Delete keys to delete that file from your computer permanently.
Now, relaunch the Internet Explorer and browse the website that was giving errors before.
Use Third-party Application
Some people use multiple browsers to keep their work and entertainment tabs separated. Well, in such a case, deleting cookies from each of the browsers can be tedious work. You need to launch and relaunch all the browsers just to clear cookies for one particular website.
For such a user, we recommend using a third party tool called CookieSpy. It is a free tool that allows you to view and delete cookies from multiple browsers in one window. The currently supported browsers are Google Chrome, Mozilla Firefox, Apple Safari, Internet Explorer, and Opera.
CookieSpy can be used only to view and delete cookies. It does not support any other feature than that. This makes it convenient for people who want an app just to clear cookies from different browsers.
When you install CookieSpy, it will detect all the browsers on your computer and have tabs for all the different browsers showing saved cookies. You can delete cookies for any site on any browser from the CookieSpy window.
Download CookieSpy
Conclusion
The 400 error can be seen anywhere while you use the browser. It can get extremely annoying when you are not able to access important work-related websites. The website itself can resolve the 400 Bad Request, Request Header or Cookie Too Large error message in a few minutes if the error is from their end because of cookie size.
However, if the error is because of corrupt cookies in your browser, the only way to fix the 400 Bad Request error message is to clear cookies for that website. You can easily clear cookies from Google Chrome, Microsoft Edge, Mozilla Firefox, and Opera Browser. But when it comes to Internet Explorer, you need to delete it via File Explorer.
The process of clearing cookies for Internet Explorer via File Explorer is mentioned above, but we recommend switching from Internet Explorer to a different browser, as Microsoft is ending support for Internet Explorer from August 2021.
При переходе на какую-либо интернет-страницу пользователь может столкнуться с невозможностью открытия данной страницы, и соответствующими сообщениями «400 Bad request» и 504 Gateway Time-out. Последнее обычно указывает на наличие в пользовательской интернет-ссылке синтаксических ошибок, а также на возможные проблемы в работе провайдера и пользовательского ПК. В данном материале я расскажу, что такое Bad request 400, каковы причины данной дисфункции, и поделюсь инструкцией по её исправлению.

Содержание
- Что значит 400 Bad Request и каковы его причины
- Как исправить ошибку 400
- Что это 400 Bad Request Request Header Or Cookie Too Large nginx?
- Заключение
Что значит 400 Bad Request и каковы его причины
В переводе с английского языка текст данного сообщения звучит как «400 плохой запрос», и обычно обозначает ситуацию, при которой пользователь использовал неправильный синтаксис при обращении к какому-либо сетевому ресурсу.
Проще говоря, пользовательский запрос, который был отправлен на какой-либо сервер (часто это тривиальный запрос на загрузку интернет-страницы), был некорректен или повреждён, и сервер не смог распознать его.
Причины появления 400 Bad request могут быть следующими:
- Пользователь использовал некорректный текст ссылки (недостающие или лишние символы, пробелы и т.д.);
- Куки пользовательского браузера повреждены;
- Наблюдаются проблемы в работе провайдера (ISP);
- Имеются проблемы с пользовательским подключением к Интернету;
- Корректное подключение к интернету блокируют антивирус или брандмауэр;
- Имеются проблемы в работе DNS;
- Злокачественная деятельность вирусных программ блокирует доступ к нужному сайту.

После того, как мы разобрались с тем, что означает 400 bad request необходимо приступать к её устранению.
Как исправить ошибку 400
Чтобы избавиться от ошибки выполните следующее:
- Внимательно проверьте используемую вами интернет-ссылку на наличие ошибок (лишние или недостающие символы, пробелы, неиспользуемые символы типа % и др.). Введите корректную ссылку и повторите запрос;

Проверьте правильность ссылки в адресной строке вашего браузера - Очистите кэш и куки вашего браузера. К примеру, в Мозилле это делается путём перехода в «Настройки» — «Приватность», и удалением истории после закрытия браузера (кэш и куки будут удалены). Поскольку многие сайты выдают ошибку 400 когда их куки повреждены или устарели, то очистка куки поможет устранить ошибку 400 Bad request;
- Очистите кэш DNS. Для этого откройте командную строку от имени администратора, в ней введите: ipconfig /flushdns и нажмите ввод;
- Временно отключите ваш антивирус и брандмауэр. Последние могут блокировать доступ к нужному сайту, и их временная деактивация поможет в решении проблемы ошибки 400;
- Защитите свой ПК от вирусов с помощью 3 практических советов и проверьте ваш компьютер на наличие вирусов онлайн. Помогут такие инструменты как «Dr.Web CureIt!», «Trojan Remover», «AdwCleaner» и другие аналоги;

- Если вы получили ошибку 400 во время загрузки какого-либо файла на сервер, то это может означать, что данный файл слишком большой, и сервер не принимает его;
- Если ошибка 400 случается практически на каждом сайте, тогда, вполне возможно, имеются проблемы у вашего провайдера, или с вашим интернет-соединением. Проверьте скорость вашего интернета (помогут сетевые тесты скорости уровня «Speedtest.net»), а также уточните у провайдера, не ведутся ли у него какие-либо технические работы;

Используйте сетевые сервисы уровня speedtest.net для проверки скорости вашего интернета - Попробуйте обратиться к нужному сайту напрямую (то есть, к примеру, вместо otvet.mail.ru/?fr=mailrufm=2 обратитесь напрямую к www.mail.ru). Возможно, с конкретной страницей у сайта наблюдаются проблемы, и будет не лишним сообщить о них администрации ресурса;
- Просто подождите. Возможно, на сайте наблюдаются технические проблемы, и вскоре они будут решены.
Также ряд пользователей может встретиться с ошибкой «Request Header Or Cookie Too Large nginx», которая обычно возникает при просмотре видео на каких-либо сетевых ресурсах.

Как указано в тексте самой ошибки, данная проблема обычно связана с повреждёнными куками на компьютере пользователя. Для её решения будет достаточно перейти в настройки вашего браузера, очистить кэш и куки, а затем и перезапустить сам браузер. После этого проблема обычно бывает решена.
Заключение
Мы рассмотрели, что такое 400 Bad request, каковы причины появления данной дисфункции, и как её исправить. В большинстве случаев фактором возникновения данной проблемы является некорректный текст ссылки, введённой пользователем в адресной строке браузера. Решением проблемы станет выполнение перечисленных мной советов, они помогут исправить ошибку на вашем ПК.
Опубликовано 05.09.2017 Обновлено 04.11.2020
-
MiniTool
-
MiniTool News Center
- How to Fix the “Request Header Or Cookie Too Large” Issue
By Daisy | Follow |
Last Updated May 31, 2021
![]()
When you visit a website on Google Chrome, IE, Firefox, Microsoft Edge, you may receive the “Request Header Or Cookie Too Large” error message. When you receive it, you can read this post from MiniTool to find some useful methods to get rid of it.
Maybe you have received the “400 Bad Request. Request Header or Cookie Too Large» error message. The Nginx web server is the sculpt. Sometimes, websites that use the software do not allow the use of browser cookies of a certain size, or the cookie stored in the browser may be corrupted. Now, let’s see how to fix the “cookie too big” issue.
For Google Chrome
If you are a Google Chrome user, you can refer to this part. You can fix the “ 400 Bad Request. Request Header Or Cookie Too Large” by checking and deleting the cookies of that particular domain in the cookie section of the Chrome. Here are the details.
Step 1: Open Google Chrome and click the Settings option.
Step 2: Navigate to the Privacy and security part and click the Site settings option.

Step 3: Click Cookies and site data and click See all cookies and site data. Then, click the Remove All option.
Then, you can check if the “Request Header Or Cookie Too Large” has been fixed.
Also see: How to Clear Cookies on Chrome, Firefox and Edge
For Internet Explorer
If you are a Internrt Exporer user, you can read this part. Now, follow the steps below to fix the “request header too large” issue.
Step 1: Click the Settings icon and select Internet options from the drop-down menu.
Step 2: Navigate to the General tab and go to the Browsing History part. Then click Settings and click View files.

Now search the folder you just opened in File Explorer for the site in question. Then delete the cookies. Then, check to see if the “cookie too big” issue has gone.
For Firefox
If you are a Firefox user, the content in this part is what you need. The solution is the same, that is to say, you need to remove the cache files of that particular website to fix the “Request Header Or Cookie Too Large” issue. Here is how to do that:
Step 1: Open Firefox and click the Options. Then, click the Privacy option.
Step 2: Select History and click the Remove individual cookies option. Now search for the website which is troubling you and delete the cookies related to it.
Step 3: Restart Firefox to check if the “Request Header Or Cookie Too Large” has been fixed.
Also see: Firefox Not Responding? Here Are 4 Effective Fixes for You
For Microsoft Edge
If you are the Microsoft Edge user, you can read this part. Now, the steps are as follows:
Step 1: Click the three horizontal dots in the upper right-hand corner.
Step 2: Now, click the Privacy & Security tab. Go to the Choose what to clear part and click choose what to clear option. Check the Cookies and saved website data option.
Step 3: Now click Clear. Then, restart the browser and check to see if the issue has been fixed.
Final Words
From this post, you can know how to fix the “Request Header Or Cookie Too Large” issue on Google Chrome, IE, Firefox, Microsoft Edge. If you encounter the same issue, you can refer to this post. If you have any better ideas to fix the error, you can share it in the comment zone.
About The Author
Position: Columnist
She was graduated from the major in English. She has been the MiniTool editor since she was graduated from university. She specializes in writing articles about backing up data & systems, cloning disks, and syncing files, etc. She is also good at writing articles about computer knowledge and computer issues. In daily life, she likes running and going to the amusement park with friends to play some exciting items.