HTTP directives

keepalive_timeout directive (HTTP client)

In http, server or location. Default 75s. Controls how long an idle reusable client connection remains open. Zero disables client keep-alive. Not the similarly named upstream directive.

Formal Syntax & Structure

nginx syntaxnginx
keepalive_timeout timeout [header_timeout];

Parameters & Attributes

NameTypeDescription
timeouttimeIdle timeout.
header_timeouttimeOptional advertised Keep-Alive timeout; may differ from actual timeout.

Working Example

Example Snippetnginx
keepalive_timeout 5s;
Nginx Reference