Thursday 19 December 2019

NGINX: client_body_buffer_size: Set client body buffer size


client_body_buffer_size directive is used to set the buffer size for reading client request body.

Syntax:  client_body_buffer_size size;
Default: client_body_buffer_size 8k|16k;
Context: http, server, location

If the request body is greater than the buffer size, the whole body or only some part of the body is written to a temporary file (disk).

What is the default buffer size?
Default buffer size depends on operating system. Size is 8K on x86, other 32-bit platforms, and x86-64. It is usually 16K on other 64-bit platforms.

nginx.conf
events {
}

http {
    include mime.types;

    # Buffer size for POST submissions
    client_body_buffer_size 10K;

    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