Open-Source Wikis

/

Traefik

/

Features

/

HTTP provider

traefik/traefik

HTTP provider

The HTTP provider polls a URL on a schedule and uses the response body as a dynamic configuration. It's the simplest way to feed Traefik from a custom control plane.

Source

pkg/provider/http/http.go. Small file, small provider.

Configuration

providers:
  http:
    endpoint: https://config.internal/traefik
    pollInterval: 10s
    pollTimeout: 5s
    headers:
      Authorization: Bearer ${TRAEFIK_HTTP_TOKEN}
    tls:
      insecureSkipVerify: false
      caFile: /etc/ssl/internal-ca.pem

endpoint is required; everything else has sensible defaults.

The endpoint must respond with a YAML, TOML, or JSON dynamic.Configuration body. Content is auto-detected from the Content-Type header.

Behavior

graph LR
    Conf --> Init
    Init --> Tick[time.Ticker]
    Tick --> Get[GET endpoint]
    Get --> Parse[parse YAML/TOML/JSON]
    Parse --> Send[dynamic.Message]

If the endpoint is unreachable or returns an error, the provider logs a warning and re-polls on the next tick. There is no exponential backoff — the polling interval is the only knob.

Use cases

  • A central control plane that exposes one endpoint with the merged configuration.
  • A jq/yq pipeline that builds configuration from another source and serves it via a tiny HTTP server.
  • A Lambda/Cloud Function that produces configuration on demand.

For a push-based alternative, see REST — the operator pushes configuration to Traefik instead of Traefik polling.

Tests

  • pkg/provider/http/http_test.go covers polling, parsing, and error handling.
  • integration/http_test.go exercises the provider against a fake configuration server.

Practical notes

  • Pin the request to a stable, idempotent URL. Anything that returns different data without a real configuration change creates noise in the watcher.
  • Use HTTPS plus caFile for production. The provider does not authenticate the body — the transport is the only line of defense.
  • Combine with templating in your control plane to handle environment-specific overrides; the provider itself does not template.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

HTTP provider – Traefik wiki | Factory