# Large\_client\_header\_buffers directive is accepted in server, but ignored

**URL:** <https://www.ruby-forum.com/t/large-client-header-buffers-directive-is-accepted-in-server-but-ignored/193475>\
**Category:** NGINX\
**Created:** [August 18, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/large-client-header-buffers-directive-is-accepted-in-server-but-ignored/193475 "2010-08-18T12:20:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brane\_FSGraSSSSnar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Brane\_FSGraSSSSnar](https://www.ruby-forum.com/u/Brane_FSGraSSSSnar)\
**Post date:** [August 18, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/large-client-header-buffers-directive-is-accepted-in-server-but-ignored/193475/1 "2010-08-18T12:20:05Z")

</div>

Hello there!

We noticed quite lots of “414 Request URI to large” messages in nginx  
error  
logs for one of configured virtualhosts and decided to bump  
large\_client\_headers\_buffers directive in server (virtualhost) context.

According to wiki documentation at  
[Module ngx\_http\_core\_module](http://wiki.nginx.org/NginxHttpCoreModule#large_client_header_buffers),  
directive should be accepted and evaluated in http AND server context.

Directive is accepted, but completely ignored and 414 issue remains.  
However,  
problem is fixed if i move large\_client\_headers\_buffers directive  
outside  
server context to http context.

We’re using nginx 0.8.37. Considering changelog issue should be also  
present  
in 0.8.49, becouse there are only two mentions of  
large\_client\_headers\_buffers  
directive.

Where is bug: in implementation or documentation? Either way, it should  
be  
fixed 🙂

Best regards, Brane

---

<div class="post-metadata">

**Author:** ![Brane\_FSGraSSSSnar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Brane\_FSGraSSSSnar](https://www.ruby-forum.com/u/Brane_FSGraSSSSnar)\
**Post date:** [August 18, 2010, 12:42pm UTC](https://www.ruby-forum.com/t/large-client-header-buffers-directive-is-accepted-in-server-but-ignored/193475/2 "2010-08-18T12:42:54Z")

</div>

Hello!

On Wed, Aug 18, 2010 at 12:18:49PM +0200, Brane F. GraÄnar wrote:

> Directive is accepted, but completely ignored and 414 issue remains. However,  
> problem is fixed if i move large\_client\_headers\_buffers directive outside  
> server context to http context.
> 
> We’re using nginx 0.8.37. Considering changelog issue should be also present  
> in 0.8.49, becouse there are only two mentions of large\_client\_headers\_buffers  
> directive.
> 
> Where is bug: in implementation or documentation? Either way, it should be  
> fixed 🙂

It is only possible to use large\_client\_header\_buffers from server  
block which is default on a listen socket in question. The reason  
is obvious: there are no information about name-based virtual  
hosts before we were able to parse headers.

E.g. this will work as expected, with one 4k buffer in server1 on  
port 8081 and 4 buffers in server2 on port 8082:

http {  
server {  
listen 8081;  
server\_name server1;  
large\_client\_header\_buffers 1 4k;  
}  
server {  
listen 8081;  
server\_name server2;  
large\_client\_header\_buffers 4 4k;  
}  
}

but this won’t (for both servers one 4k buffer will be used):

http {  
server {  
listen 8080;  
server\_name server1;  
large\_client\_header\_buffers 1 4k;  
}  
server {  
listen 8080;  
server\_name server2;  
large\_client\_header\_buffers 4 4k;  
}  
}

as one can’t distingush server1 and server2 without parsing  
headers.

So wiki is basically correct (as well as docs), and code works as  
intended, but there are some nuances… 😉

Maxim D.
