Friday 27 December 2019

NGINX: keepalive_timeout: Maximum time a connection is open for client


‘keepalive_timeout’ directive sets maximum time a connection is open for a client. If client want to send more data, then we can adjust the time using this directive.

Syntax:  keepalive_timeout timeout [header_timeout];
Default: keepalive_timeout 75s;
Context: http, server, location

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;

    keepalive_timeout 75s;

    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