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 (TOML)

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

File (YAML)

  1. providers:
  2. http:
  3. endpoint:
  4. - "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 (TOML)

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

File (YAML)

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

CLI

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

pollTimeout

Optional, Default=”5s”

Defines the polling timeout when connecting to the configured endpoint.

File (TOML)

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

File (YAML)

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

CLI

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

tls

Optional

tls.ca

Certificate Authority used for the secured connection to the configured Endpoint.

File (TOML)

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

File (YAML)

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

CLI

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

tls.caOptional

Policy followed for the secured connection with TLS Client Authentication to the configured Endpoint. Requires tls.ca to be defined.

  • true: VerifyClientCertIfGiven
  • false: RequireAndVerifyClientCert
  • if tls.ca is undefined NoClientCert

    File (TOML)

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

File (YAML)

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

CLI

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

tls.cert

Public certificate used for the secured connection to the configured Endpoint.

File (TOML)

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

File (YAML)

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

CLI

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

tls.key

Private certificate used for the secured connection to the configured Endpoint.

File (TOML)

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

File (YAML)

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

CLI

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

tls.insecureSkipVerify

If insecureSkipVerify is true, TLS connection to the configured Endpoint accepts any certificate presented by the server and any host name in that certificate.

File (TOML)

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

File (YAML)

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

CLI

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