Node / NGINX 400 Request header or too many cookies

Problem

I am trying to send a request to a remote nginx (1.10.0) / node (4.2.6) server running on ubuntu (14.04) linux. It usually works most of the time, but if the header is large, the request fails with the following error.

< html > < head > < title > 400 Request Header Or Cookie Too Large < /title></head > < body bgcolor = "white" > < center > < h1 > 400 Bad Request < /h1></center > < center > Request Header Or Cookie Too Large < /center></body > < /html>

      

The size of my test header is 8,260 bytes and consists of comma separated IDs like below ...

4322,6543,4756352,745635,7456,7546345,2343

      

Attempt to fix

I added the following to my nginx config (as per a lot of google and stack overflow suggestions) and nothing fixed it. After these configuration changes, I restarted the nginx server and tested on chrome and safari ...

large_client_header_buffers 4 32k;
client_body_buffer_size 32K;
client_header_buffer_size 32k;
client_max_body_size 20M;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;
proxy_connect_timeout       60;
proxy_read_timeout          120;

      

Any ideas are appreciated.

+3


source to share





All Articles