client_header_timeout

Sets the timeout for reading the client request header.

Syntaxclient_header_timeout time;
Default60s
Contexthttp, server
Arguments1

Description

The client_header_timeout directive defines the maximum time the server will wait for a client to send the request headers. It is specified in seconds, and if the timeout period is exceeded, NGINX will close the connection and return an error to the client. This directive is useful in preventing the server from being tied up by slow clients that do not send their headers in a timely manner. The timeout value can be configured globally in the http context or for specific server blocks. The timeout applies to the reading of the full request header, which includes both the request line and all headers sent by the client. If a request exceeds this time limit, the connection is dropped to free up server resources and maintain performance.

Config Example

http {
    client_header_timeout 30s;
    server {
        # Server configuration
    }
}

Setting a value too low may result in legitimate clients being disconnected prematurely.

This directive is not effective if the server is also managing timeouts at the upstream server or client-side.

Changes to this directive require a reload of NGINX for them to take effect.

← Back to all directives