Nginx returning 414 even when large_client_header_buffers is set

Maxim Dounin mdounin at
Tue Apr 10 20:09:56 UTC 2012


On Tue, Apr 10, 2012 at 04:03:50PM -0400, spacerobot wrote:

> It appears that no matter how big I set the value of
> large_client_header_buffers to be, nginx just doesn't care of the
> setting and still returns 414 on a long request. 
> I tried to make it 16k, 32k, 256k, and 512k, etc and POSTing a request
> with 1.5k long URL returns 414. It works when I reduce the request URI
> length to about 1k, regardless of the large_client_header_buffers value
> as well.
> I also tried to set proxy_buffers to a large value and didn't help.
> Is there any other settings I need to look at to make the nginx box take
> longer request URI without returning 414?

Most likely you are trying to configure 
client_header_buffer_size/large_client_header_buffers in a pure 
virtual server{}.  This won't work as request headers parsing 
happens before Host header is known (and virtual server is 
selected), hence parseing happens in a context of the default 
server for a listen socket.

You have to configure client_header_buffer_size/large_client_header_buffers 
in a default server (or at http level).

Maxim Dounin

More information about the nginx mailing list