Welcome! Log In Create A New Profile

Advanced

Re: Nginx returning 414 even when large_client_header_buffers is set

Maxim Dounin
April 11, 2012 03:22AM
Hello!

On Tue, Apr 10, 2012 at 07:45:21PM -0400, spacerobot wrote:

> Hello,
>
> spacerobot Wrote:
> -------------------------------------------------------
> > > Most likely you are trying to configure
> > >
> > client_header_buffer_size/large_client_header_buff
> >
> > > ers 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_buff
> >
> > > ers
> > > in a default server (or at http level).
> > >
> >
> > I tried to set it in the http context of the main
> > /etc/nginx/nginx.conf file:
> >
> > http {
> > large_client_header_buffers 8 512k;
> >
> > ...
> > include /etc/nginx/sites-enabled/*;
> > }
> >
> > And my server contexts are defined in a conf file
> > in sites-enabled. But large_client_header_buffers
> > still appears to be ignored.
>
> I further tried the following things, which didn't help either:
> - took out most of the configs in my nginx.conf and now I have the
> simplest configuration possible, as below.
> - upgraded to 1.0.14 stable from 1.0.12 development.
>
> My new simplified nginx.conf:
>
> worker_processes 2;
> daemon off;
>
> error_log /var/log/nginx/error.log;
>
> events {
> worker_connections 2048;
> }
>
> http {
> client_header_buffer_size 256k;
> large_client_header_buffers 8 1024k;
>
> upstream foo.com {
> server 10.0.0.99:16234;
> server 10.0.0.20:16234;
> }
>
> server {
> listen 443;
>
> ssl on;
> ssl_certificate /etc/foo.com.crt;
> ssl_certificate_key /etc//foo.com.key;
>
> server_name foo;
>
> access_log /var/log/nginx/access.log main;
>
> set $foo "foo.com";
>
> location / {
> proxy_set_header x-foo-rid $request_id;
> proxy_redirect http://$foo /;
> proxy_pass http://$foo;
> }
> }
> }

Are you sure the error is returned by this nginx instance, not by
your http backends?

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx returning 414 even when large_client_header_buffers is set

spacerobot April 09, 2012 09:28PM

Re: Nginx returning 414 even when large_client_header_buffers is set

spacerobot April 10, 2012 04:03PM

Re: Nginx returning 414 even when large_client_header_buffers is set

Maxim Dounin April 10, 2012 04:12PM

Re: Nginx returning 414 even when large_client_header_buffers is set

spacerobot April 10, 2012 04:26PM

Re: Nginx returning 414 even when large_client_header_buffers is set

spacerobot April 10, 2012 07:45PM

Re: Nginx returning 414 even when large_client_header_buffers is set

Maxim Dounin April 11, 2012 03:22AM

Re: Nginx returning 414 even when large_client_header_buffers is set

spacerobot April 11, 2012 07:09PM

Re: Nginx returning 414 even when large_client_header_buffers is set

ct323i February 11, 2014 12:22PM

Re: Nginx returning 414 even when large_client_header_buffers is set

Spencer Fu November 11, 2015 12:38PM

Re: Nginx returning 414 even when large_client_header_buffers is set

B.R. November 11, 2015 05:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 109
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready