Friday, 27 December 2019

NGINX: client_body_timeout: Specify time out to read client request body


client_body_timeout’ directive is used to specify the time out to read client request body.

Syntax: client_body_timeout time;
Default: client_body_timeout 60s;
Context: http, server, location

What if client do not send the body within given time?
Request is terminated with the 408 (Request Time-out) error.

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;

    client_body_timeout 60s;

    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