Friday, 27 December 2019

NGINX: client_header_timeout: Specify time out to read client headers

client_header_timeout’ directive is used to specify time out to read client request headers.

Syntax:  client_header_timeout time;
Default: client_header_timeout 60s;
Context: http, server

What if client do not send the header 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;

    client_header_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