We have few requests that takes http headers size more than the default accepted size in our tomcat application i.e., maxHttpHeaderSize = 8192 (https://tomcat.apache.org/tomcat-8.0-doc/config/http.html)
And also nginx, has a default limit for buffers that can be allocated for large client requests i.e., large_client_header_buffers size = 8K (http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers)
However, without increasing the large_client_header_buffers on nginx side, requests can still go through if just maxHttpHeaderSize parameter in tomcat is increased.
As per nginx documentation, "Buffers are allocated only on demand." I do not understand this. Are buffers not allocated for every request?