Traefik & Redis

Configuration Example

You can enable the Redis provider as detailed below:

File (YAML)

  1. providers:
  2. redis: {}

File (TOML)

  1. [providers.redis]

CLI

  1. --providers.redis.endpoints=true

Configuration Options

FieldDescriptionDefaultRequired
providers.providersThrottleDurationMinimum amount of time to wait for, after a configuration reload, before taking into account any new configuration refresh event.
If multiple events occur within this time, only the most recent one is taken into account, and all others are discarded.
This option cannot be set per provider, but the throttling algorithm applies to each of them independently.
2sNo
providers.redis.endpointsDefines the endpoint to access Redis.“127.0.0.1:6379”Yes
providers.redis.rootKeyDefines the root key for the configuration.“traefik”Yes
providers.redis.usernameDefines a username for connecting to Redis.“”No
providers.redis.passwordDefines a password for connecting to Redis.“”No
providers.redis.dbDefines the database to be selected after connecting to the Redis.0No
providers.redis.tlsDefines the TLS configuration used for the secure connection to Redis.-No
providers.redis.tls.caDefines the path to the certificate authority used for the secure connection to Redis, it defaults to the system bundle.“”No
providers.redis.tls.certDefines the path to the public certificate used for the secure connection to Redis. When using this option, setting the key option is required.“”Yes
providers.redis.tls.keyDefines the path to the private key used for the secure connection to Redis. When using this option, setting the cert option is required.“”Yes
providers.redis.tls.insecureSkipVerifyInstructs the provider to accept any certificate presented by Redis when establishing a TLS connection, regardless of the hostnames the certificate covers.falseNo
providers.redis.sentinelDefines the Sentinel configuration used to interact with Redis Sentinel.-No
providers.redis.sentinel.masterNameDefines the name of the Sentinel master.“”Yes
providers.redis.sentinel.usernameDefines the username for Sentinel authentication.“”No
providers.redis.sentinel.passwordDefines the password for Sentinel authentication.“”No
providers.redis.sentinel.latencyStrategyDefines whether to route commands to the closest master or replica nodes (mutually exclusive with RandomStrategy and ReplicaStrategy).falseNo
providers.redis.sentinel.randomStrategyDefines whether to route commands randomly to master or replica nodes (mutually exclusive with LatencyStrategy and ReplicaStrategy).falseNo
providers.redis.sentinel.replicaStrategyDefines whether to route commands randomly to master or replica nodes (mutually exclusive with LatencyStrategy and ReplicaStrategy).falseNo
providers.redis.sentinel.useDisconnectedReplicasDefines whether to use replicas disconnected with master when cannot get connected replicas.falsefalse

Routing Configuration

See the dedicated section in routing.