C
C
cjitkul332017-04-30 10:55:46
Nginx
cjitkul33, 2017-04-30 10:55:46

Request Header Or Cookie Too Large. Why?

Recently (several months) I often come across sites with the "Request Header Or Cookie Too Large" error.
-----
400 Bad Request
Request Header Or Cookie Too Large
nginx
-----
And on reputable sites like yandex, alpha-bank.
The essence of the error is clear and clearing cookies helps. It is not clear why it was not before, but now often.
Windows ten, chrome every time the last at the time of the error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
My joy, 2018-01-13
@t-alexashka

This happens when the transition comes from a search engine, and some title (in most cases, this is the referer) is too long. For example, a Yandex referrer can be like this: (it is he who causes an error on my site)
nginx did not expect such a fat heading and resets the connection just in case. You need to poke around in the nginx settings to increase the possible length of headers.
If such an error occurs on your nginx site when you go from Yandex (especially from it), then set a larger allowable header size in the nginx.conf settings:

server {
   #...
   client_header_buffer_size 4k;
   #...
}

The default is 1kb. Even if 4k is not enough (which is unlikely), put 6k, but it’s better to check your browser cookies before that, they may be clogged with unnecessary rubbish, the volume of which exceeds the allowable one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question