title: Node/NGINX 400 Request Header Or Cookie Too Large
body: <p><strong>Problem</strong></p>
  
  <p>I am attempting to send a request to a remote nginx (1.10.0) / node (4.2.6) server running on ubuntu (14.04) linux. It works normally most of the time, but if a header is large in size, the request fails with the following error..</p>
  
  <pre><code>&lt; html &gt; &lt; head &gt; &lt; title &gt; 400 Request Header Or Cookie Too Large &lt; /title&gt;&lt;/head &gt; &lt; body bgcolor = "white" &gt; &lt; center &gt; &lt; h1 &gt; 400 Bad Request &lt; /h1&gt;&lt;/center &gt; &lt; center &gt; Request Header Or Cookie Too Large &lt; /center&gt;&lt;/body &gt; &lt; /html&gt;
  </code></pre>
  
  <p>My test header size is 8,260 bytes and is comprised of comma separated IDs, like below...</p>
  
  <pre><code>4322,6543,4756352,745635,7456,7546345,2343
  </code></pre>
  
  <p><strong>Attempted Fixes</strong></p>
  
  <p>I have added the following to my nginx config (as per many suggestions on google and stack overflow) and nothing has fixed it. Following these config changes I restarted the nginx server and tested on chrome and safari...</p>
  
  <pre><code>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;
  </code></pre>
  
  <p>Any ideas welcome.</p>