proxy_timeout

The `proxy_timeout` directive sets the maximum timeout for connections in NGINX's Mail Core module.

Syntaxproxy_timeout time;
Defaultnone
Contextmail, mail server
Arguments1

Description

The proxy_timeout directive configures the maximum time that the mail server will wait for a client connection to remain idle before it disconnects. This directive is critical for controlling resource utilization and ensuring that long-lived connections do not consume server resources unnecessarily.

The directive accepts a single parameter, which specifies the timeout period. The time can be defined in seconds, with optional suffixes for greater precision, such as 1m for one minute or 1h for one hour. If the specified timeout is reached without any activity on the connection, the server will terminate that connection, freeing resources for other active connections. This helps in managing server capacity, particularly in environments with high traffic.

This directive can be applied in the context of mail or mail server, directly affecting the mail server's performance and reliability. Proper tuning of this setting is essential, as too short a timeout may inadvertently close active connections, while a timeout that is too long may lead to wasted resources and slow performance under load.

Config Example

mail {
    proxy_timeout 10s;
}

Setting the timeout too low can cause abrupt disconnections for users with slow connections.

If this directive is not specified, the default behavior may lead to longer than necessary hold times for idle connections.

← Back to all directives