bot_verifier_redis_connection_timeout

Sets the connection timeout for Redis when using the bot verification module.

Syntaxbot_verifier_redis_connection_timeout ;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The bot_verifier_redis_connection_timeout directive specifies the timeout period for establishing a connection to the Redis instance used by the NGINX bot verification module. This directive is critical for ensuring that the module can handle request verification in a timely manner without hanging indefinitely when Redis is unavailable. The value is specified in seconds and defaults to none, meaning it is mandatory to set this directive in your configuration.

When a request is processed, the module will attempt to connect to Redis according to the defined timeout value. If the connection to Redis cannot be established within the timeout period, it will log an error message and decide whether to bypass the verification process for that request based on the module's configuration state. Consequently, setting this timeout not only impacts the efficiency of request handling but also determines how swiftly the module can react in scenarios where Redis is experiencing latency or other issues.

Config Example

location / {
    bot_verifier on;
    bot_verifier_redis_host localhost;
    bot_verifier_redis_port 6379;
    bot_verifier_redis_connection_timeout 10;
    bot_verifier_redis_read_timeout 10;
    bot_verifier_redis_expiry 3600;
    bot_verifier_repsheet_enabled on;
}

If not set, the default connection timeout is 'none', which can lead to potential hangs when Redis is down or slow.

Be mindful to set this value reasonably high to account for Redis performance but low enough to prevent long wait times for the user.

Setting it too low may result in frequent failures to communicate with Redis under normal load conditions.

← Back to all directives