Friday 27 December 2019

NGINX: client_header_buffer_size: Set client header buffer size


client_header_buffer_size directive sets buffer size for reading client request headers. For most requests, a buffer of 1K bytes is enough.

Syntax:  client_header_buffer_size size;
Default: client_header_buffer_size 1k;
Context: http, server

What if my request header not fit into buffer?
Use large_client_header_buffers directive. It is used to set the maximum number and size of buffers used for reading large client request header.

Syntax: large_client_header_buffers number size;
Default: large_client_header_buffers 4 8k;
Context: http, server

nginx.conf
events {
}

http {
    include mime.types;

    # Buffer size for POST submissions
    client_body_buffer_size 10K;
    client_max_body_size 4m;

    # Buffer size for Headers
    client_header_buffer_size 1k;

    server {
        listen 9090;

        server_name localhost;

        location = /about{
            return 200 "Hello Welcome to NGINX";
        }

        location = /not_found{
            return 404 "File can't be found";
        }
    }
}




Previous                                                    Next                                                    Home

No comments:

Post a Comment