Traefik & HTTP

Provide your dynamic configuration via an HTTP(S) endpoint and let Traefik do the rest!

Routing Configuration

The HTTP provider uses the same configuration as the File Provider in YAML or JSON format.

Provider Configuration

endpoint

Required

Defines the HTTP(S) endpoint to poll.

File (YAML)

  1. providers:
  2. http:
  3. endpoint: "http://127.0.0.1:9000/api"

File (TOML)

  1. [providers.http]
  2. endpoint = "http://127.0.0.1:9000/api"

CLI

  1. --providers.http.endpoint=http://127.0.0.1:9000/api

pollInterval

Optional, Default=”5s”

Defines the polling interval.

File (YAML)

  1. providers:
  2. http:
  3. pollInterval: "5s"

File (TOML)

  1. [providers.http]
  2. pollInterval = "5s"

CLI

  1. --providers.http.pollInterval=5s

pollTimeout

Optional, Default=”5s”

Defines the polling timeout when connecting to the endpoint.

File (YAML)

  1. providers:
  2. http:
  3. pollTimeout: "5s"

File (TOML)

  1. [providers.http]
  2. pollTimeout = "5s"

CLI

  1. --providers.http.pollTimeout=5s

tls

Optional

Defines the TLS configuration used for the secure connection to the endpoint.

ca

Optional

ca is the path to the certificate authority used for the secure connection to the endpoint, it defaults to the system bundle.

File (YAML)

  1. providers:
  2. http:
  3. tls:
  4. ca: path/to/ca.crt

File (TOML)

  1. [providers.http.tls]
  2. ca = "path/to/ca.crt"

CLI

  1. --providers.http.tls.ca=path/to/ca.crt

cert

Optional

cert is the path to the public certificate used for the secure connection to the endpoint. When using this option, setting the key option is required.

File (YAML)

  1. providers:
  2. http:
  3. tls:
  4. cert: path/to/foo.cert
  5. key: path/to/foo.key

File (TOML)

  1. [providers.http.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --providers.http.tls.cert=path/to/foo.cert
  2. --providers.http.tls.key=path/to/foo.key

key

Optional

key is the path to the private key used for the secure connection to the endpoint. When using this option, setting the cert option is required.

File (YAML)

  1. providers:
  2. http:
  3. tls:
  4. cert: path/to/foo.cert
  5. key: path/to/foo.key

File (TOML)

  1. [providers.http.tls]
  2. cert = "path/to/foo.cert"
  3. key = "path/to/foo.key"

CLI

  1. --providers.http.tls.cert=path/to/foo.cert
  2. --providers.http.tls.key=path/to/foo.key

insecureSkipVerify

Optional, Default=false

If insecureSkipVerify is true, the TLS connection to the endpoint accepts any certificate presented by the server regardless of the hostnames it covers.

File (YAML)

  1. providers:
  2. http:
  3. tls:
  4. insecureSkipVerify: true

File (TOML)

  1. [providers.http.tls]
  2. insecureSkipVerify = true

CLI

  1. --providers.http.tls.insecureSkipVerify=true