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?
On Tue, Apr 10, 2012 at 04:03:50PM -0400, spacerobot wrote:
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).
I am encountering a very similar problem with my nginx/unicorn server
with
an 11k URI, getting error “HTTP/1.1 414 Request-URI Too Long”.
We have also modified the nginx.conf httpd context to include:
client_header_buffer_size 32k;
large_client_header_buffers 16 512k;
Which in theory should be more than sufficient to handle this URI…
Could you please give some more information on what you’ve modified with
Unicorn to allow a larger URI?
Thanks!
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.