Retry

    The Retry middleware is in charge of reissuing a request a given number of times to a backend server if that server does not reply. To be clear, as soon as the server answers, the middleware stops retrying, regardless of the response status. The Retry middleware has an optional configuration for exponential backoff.

    Docker

    Kubernetes

    1. # Retry to send request 4 times with exponential backoff
    2. apiVersion: traefik.containo.us/v1alpha1
    3. metadata:
    4. name: test-retry
    5. spec:
    6. attempts: 4
    7. initialInterval: 100ms

    Marathon

    1. "traefik.http.middlewares.test-retry.retry.attempts": "4",
    2. "traefik.http.middlewares.test-retry.retry.initialinterval": "100ms",
    3. }

    Rancher

    File (TOML)

    1. # Retry to send request 4 times
    2. [http.middlewares.test-retry.retry]
    3. initialInterval = "100ms"

    Configuration Options

    mandatory

    The attempts option defines how many times the request should be retried.

    initialInterval

    The initialInterval option defines the first wait time in the exponential backoff series (provided in seconds or as a valid duration format, see time.ParseDuration). The maximum interval is calculated as twice the . If unspecified, requests will be retried immediately.