auth_http_timeout

Sets a timeout for HTTP authorization requests in the NGINX Mail module.

Syntaxauth_http_timeout time;
Defaultnone
Contextmail, mail server
Arguments1

Description

The auth_http_timeout directive defines a timeout for communications with the HTTP server used for authentication in the NGINX Mail module. This is particularly relevant when integrating with external authentication systems, where getting a response may take longer than desired or expected. The parameter for auth_http_timeout is specified in a time format, which can include time units such as seconds (s), minutes (m), hours (h), etc.

If the specified timeout is exceeded, the mail server will return an error response to the clients. This helps in preventing indefinite blocking of mail transactions due to slow authentication responses. It is important for administrators to choose a value that balances between giving enough time for legitimate authentication processes and limiting the wait time to ensure responsiveness for users. In many use cases, a timeout of a few seconds is sufficient.

This directive can be placed in the mail or mail server context, meaning it has to be defined within the relevant block in an NGINX configuration file that pertains to mail services. As part of the configuration setup, it is imperative that this directive is correctly configured to ensure optimal mail server performance, especially in environments where user authentication against an external service is necessary.

Config Example

mail {
    auth_http_timeout 5s;
    server {
        listen 110;
        protocol pop3;
    }
}

Ensure timeout value is reasonable to avoid rejecting legitimate authentication attempts.

Verify that external HTTP authentication server is responsive within the given timeout period.

Check the validation of the time format; using invalid formats may lead to configuration errors.

← Back to all directives