traefik/docs/content/providers/http.md
Kevin Pollet 1ef93fead7
Add HTTP Provider
* feat: add HTTP provider implementation

* refactor: add SetDefaults and struct tag for the new file parser

* feat: add TLS configuration property

* refactor: rework HTTP provider implementation

* feat: provide config only once if fetched config is unchanged

* style: lint

* ui: add HTTP provider icon

* tests: simplify and fix integration test

* docs: add reference config for file

* docs: move http reference config for file

Co-authored-by: Daniel Tomcej <daniel.tomcej@gmail.com>
2020-07-15 16:56:03 +02:00

3.2 KiB

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.

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

pollInterval

Optional, Default="5s"

Defines the polling interval.

[providers.http]
  pollInterval = "5s"
providers:
  http:
    pollInterval: "5s"
--providers.http.pollInterval=5s

pollTimeout

Optional, Default="5s"

Defines the polling timeout when connecting to the configured endpoint.

[providers.http]
  pollTimeout = "5s"
providers:
  http:
    pollTimeout: "5s"
--providers.http.pollTimeout=5s

tls

Optional

tls.ca

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

[providers.http.tls]
  ca = "path/to/ca.crt"
providers:
  http:
    tls:
      ca: path/to/ca.crt
--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
[providers.http.tls]
  caOptional = true
providers:
  http:
    tls:
      caOptional: true
--providers.http.tls.caOptional=true

tls.cert

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

[providers.http.tls]
  cert = "path/to/foo.cert"
  key = "path/to/foo.key"
providers:
  http:
    tls:
      cert: path/to/foo.cert
      key: path/to/foo.key
--providers.http.tls.cert=path/to/foo.cert
--providers.http.tls.key=path/to/foo.key

tls.key

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

[providers.http.tls]
  cert = "path/to/foo.cert"
  key = "path/to/foo.key"
providers:
  http:
    tls:
      cert: path/to/foo.cert
      key: path/to/foo.key
--providers.http.tls.cert=path/to/foo.cert
--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.

[providers.http.tls]
  insecureSkipVerify = true
providers:
  http:
    tls:
      insecureSkipVerify: true
--providers.http.tls.insecureSkipVerify=true