Review documentation

This commit is contained in:
Ludovic Fernandez 2019-04-24 17:44:04 +02:00 committed by Traefiker Bot
parent c1de6abf23
commit d80700810f
7 changed files with 123 additions and 13 deletions

View file

@ -76,7 +76,7 @@ The file content is a list of `name:encoded-password`.
??? example "A file containing test/test and test2/test2" ??? example "A file containing test/test and test2/test2"
``` ```txt
test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/ test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/
test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0 test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0
``` ```
@ -109,6 +109,12 @@ spec:
headerField: X-WebAuth-User headerField: X-WebAuth-User
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.my-auth.basicauth.headerField": "X-WebAuth-User"
}
```
```toml tab="File" ```toml tab="File"
[http.middlewares.my-auth.basicauth] [http.middlewares.my-auth.basicauth]
# ... # ...

View file

@ -69,7 +69,7 @@ The file content is a list of `name:realm:encoded-password`.
??? example "A file containing test/test and test2/test2" ??? example "A file containing test/test and test2/test2"
``` ```txt
test:traefik:a2688e031edb4be6a3797f3882655c05 test:traefik:a2688e031edb4be6a3797f3882655c05
test2:traefik:518845800f9e2bfb1f1f740ec24f074e test2:traefik:518845800f9e2bfb1f1f740ec24f074e
``` ```
@ -109,6 +109,12 @@ labels:
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User" - "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.my-auth.digestauth.headerField": "X-WebAuth-User"
}
```
```toml tab="File" ```toml tab="File"
[http.middlewares.my-auth.digestAuth] [http.middlewares.my-auth.digestAuth]
# ... # ...

View file

@ -59,7 +59,7 @@ labels:
`X-Script-Name` header added to the proxied request, the `X-Custom-Request-Header` header removed from the request, `X-Script-Name` header added to the proxied request, the `X-Custom-Request-Header` header removed from the request,
and the `X-Custom-Response-Header` header removed from the response. and the `X-Custom-Response-Header` header removed from the response.
Please note that is not possible to remove headers through the use of Docker labels for now. Please note that is not possible to remove headers through the use of labels (Docker, Rancher, Marathon, ...) for now.
```yaml tab="Kubernetes" ```yaml tab="Kubernetes"
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
@ -78,7 +78,12 @@ spec:
```yaml tab="Rancher" ```yaml tab="Rancher"
labels: labels:
- "traefik.http.middlewares.testHeader.Headers.CustomRequestHeaders.X-Script-Name=test" - "traefik.http.middlewares.testHeader.Headers.CustomRequestHeaders.X-Script-Name=test"
- "traefik.http.middlewares.testHeader.Headers.CustomResponseHeaders.X-Custom-Response-Header=True" ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.testHeader.Headers.CustomRequestHeaders.X-Script-Name": "test",
}
``` ```
```toml tab="File" ```toml tab="File"
@ -119,6 +124,13 @@ labels:
- "traefik.http.middlewares.testHeader.Headers.SSLRedirect=true" - "traefik.http.middlewares.testHeader.Headers.SSLRedirect=true"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.testHeader.Headers.FrameDeny": "true",
"traefik.http.middlewares.testHeader.Headers.SSLRedirect": "true"
}
```
```toml tab="File" ```toml tab="File"
[http.middlewares] [http.middlewares]
[http.middlewares.testHeader.headers] [http.middlewares.testHeader.headers]
@ -163,6 +175,15 @@ labels:
- "traefik.http.middlewares.testHeader.Headers.AddVaryHeader=true" - "traefik.http.middlewares.testHeader.Headers.AddVaryHeader=true"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.testHeader.Headers.AccessControlAllowMethods": "GET,OPTIONS,PUT",
"traefik.http.middlewares.testHeader.Headers.AccessControlAllowOrigin": "origin-list-or-null",
"traefik.http.middlewares.testHeader.Headers.AccessControlMaxAge": "100",
"traefik.http.middlewares.testHeader.Headers.AddVaryHeader": "true"
}
```
```toml tab="File" ```toml tab="File"
[http.middlewares] [http.middlewares]
[http.middlewares.testHeader.headers] [http.middlewares.testHeader.headers]

View file

@ -101,6 +101,13 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and take th
- "traefik.http.middlewares.testIPwhitelist.ipwhitelist.ipstrategy.depth=2" - "traefik.http.middlewares.testIPwhitelist.ipwhitelist.ipstrategy.depth=2"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.testIPwhitelist.ipWhiteList.SourceRange": "127.0.0.1/32, 192.168.1.7",
"traefik.http.middlewares.testIPwhitelist.ipwhitelist.ipstrategy.depth": "2"
}
```
```toml tab="File" ```toml tab="File"
# Whitelisting Based on `X-Forwarded-For` with `depth=2` # Whitelisting Based on `X-Forwarded-For` with `depth=2`
[http.middlewares] [http.middlewares]
@ -158,6 +165,12 @@ labels:
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedIPs=127.0.0.1/32, 192.168.1.7" - "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedIPs=127.0.0.1/32, 192.168.1.7"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedIPs": "127.0.0.1/32, 192.168.1.7"
}
```
```toml tab="File" ```toml tab="File"
# Exclude from `X-Forwarded-For` # Exclude from `X-Forwarded-For`
[http.middlewares] [http.middlewares]

View file

@ -122,6 +122,28 @@ labels:
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber=true" - "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber=true"
``` ```
```json tab="Marathon"
"labels": {
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notafter": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notbefore": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.sans": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.commonname": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.country": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.domaincomponent": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.locality": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.organization": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.province": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.serialnumber": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.commonname": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.country": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.domaincomponent": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.locality": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.organization": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.province": "true",
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber": "true"
}
```
```toml tab="File" ```toml tab="File"
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header # Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
[http.middlewares] [http.middlewares]

View file

@ -7,8 +7,8 @@ The file provider lets you define the [dynamic configuration](./overview.md) in
You can write these configuration elements: You can write these configuration elements:
* At the end of the main Traefik configuration file (by default: `traefik.toml`). * At the end of the main Traefik configuration file (by default: `traefik.toml`).
* In [a dedicated file](#filename-optional) * In [a dedicated file](#filename)
* In [several dedicated files](#directory-optional) * In [several dedicated files](#directory)
!!! note !!! note
The file provider is the default format used throughout the documentation to show samples of the configuration for many features. The file provider is the default format used throughout the documentation to show samples of the configuration for many features.
@ -58,7 +58,9 @@ You can write these configuration elements:
!!! tip "Browse the Reference" !!! tip "Browse the Reference"
If you're in a hurry, maybe you'd rather go through the [static](../reference/static-configuration.md) and the [dynamic](../reference/dynamic-configuration/file.md) configuration references. If you're in a hurry, maybe you'd rather go through the [static](../reference/static-configuration.md) and the [dynamic](../reference/dynamic-configuration/file.md) configuration references.
### `filename` (_Optional_) ### `filename`
_Optional_
Defines the path of the configuration file. Defines the path of the configuration file.
@ -68,7 +70,9 @@ Defines the path of the configuration file.
filename = "rules.toml" filename = "rules.toml"
``` ```
### `directory` (_Optional_) ### `directory`
_Optional_
Defines the directory that contains the configuration files. Defines the directory that contains the configuration files.
@ -78,7 +82,9 @@ Defines the directory that contains the configuration files.
directory = "/path/to/config" directory = "/path/to/config"
``` ```
### `watch` (_Optional_) ### `watch`
_Optional_
Set the `watch` option to `true` to allow Traefik to automatically watch for file changes. Set the `watch` option to `true` to allow Traefik to automatically watch for file changes.
It works with both the `filename` and the `directory` options. It works with both the `filename` and the `directory` options.
@ -145,5 +151,4 @@ Thus, it's possible to define easily lot of routers, services and TLS certificat
[TLSConfig.TLS{{ $e }}] [TLSConfig.TLS{{ $e }}]
# ... # ...
{{ end }} {{ end }}
``` ```

View file

@ -31,8 +31,8 @@
TrustedIPs = ["foobar", "foobar"] TrustedIPs = ["foobar", "foobar"]
[Providers] [Providers]
ProvidersThrottleDuration = 42 ProvidersThrottleDuration = 42
[Providers.Docker] [Providers.Docker]
Watch = true Watch = true
Endpoint = "foobar" Endpoint = "foobar"
@ -52,18 +52,21 @@
Key = "foobar" Key = "foobar"
MustMatch = true MustMatch = true
Regex = "foobar" Regex = "foobar"
[Providers.Docker.TLS] [Providers.Docker.TLS]
CA = "foobar" CA = "foobar"
CAOptional = true CAOptional = true
Cert = "foobar" Cert = "foobar"
Key = "foobar" Key = "foobar"
InsecureSkipVerify = true InsecureSkipVerify = true
[Providers.File] [Providers.File]
Directory = "foobar" Directory = "foobar"
Watch = true Watch = true
Filename = "foobar" Filename = "foobar"
DebugLogGeneratedTemplate = true DebugLogGeneratedTemplate = true
TraefikFile = "foobar" TraefikFile = "foobar"
[Providers.Marathon] [Providers.Marathon]
Trace = true Trace = true
Watch = true Watch = true
@ -88,6 +91,7 @@
Key = "foobar" Key = "foobar"
MustMatch = true MustMatch = true
Regex = "foobar" Regex = "foobar"
[Providers.Marathon.TLS] [Providers.Marathon.TLS]
CA = "foobar" CA = "foobar"
CAOptional = true CAOptional = true
@ -97,6 +101,7 @@
[Providers.Marathon.Basic] [Providers.Marathon.Basic]
HTTPBasicAuthUser = "foobar" HTTPBasicAuthUser = "foobar"
HTTPBasicPassword = "foobar" HTTPBasicPassword = "foobar"
[Providers.Kubernetes] [Providers.Kubernetes]
Endpoint = "foobar" Endpoint = "foobar"
Token = "foobar" Token = "foobar"
@ -109,6 +114,7 @@
IP = "foobar" IP = "foobar"
Hostname = "foobar" Hostname = "foobar"
PublishedService = "foobar" PublishedService = "foobar"
[Providers.KubernetesCRD] [Providers.KubernetesCRD]
Endpoint = "foobar" Endpoint = "foobar"
Token = "foobar" Token = "foobar"
@ -117,9 +123,29 @@
Namespaces = ["foobar", "foobar"] Namespaces = ["foobar", "foobar"]
LabelSelector = "foobar" LabelSelector = "foobar"
IngressClass = "foobar" IngressClass = "foobar"
[Providers.Rest] [Providers.Rest]
EntryPoint = "foobar" EntryPoint = "foobar"
[Providers.Rancher]
Watch = true
DefaultRule = "foobar"
ExposedByDefault = true
EnableServiceHealthFilter = true
RefreshSeconds = 42
IntervalPoll = true
Prefix = "foobar"
[[Providers.Rancher.Constraints]]
Key = "foobar"
MustMatch = true
Regex = "foobar"
[[Providers.Rancher.Constraints]]
Key = "foobar"
MustMatch = true
Regex = "foobar"
[API] [API]
EntryPoint = "foobar" EntryPoint = "foobar"
Dashboard = true Dashboard = true
@ -128,16 +154,20 @@
RecentErrors = 42 RecentErrors = 42
[Metrics] [Metrics]
[Metrics.Prometheus] [Metrics.Prometheus]
Buckets = [42.0, 42.0] Buckets = [42.0, 42.0]
EntryPoint = "foobar" EntryPoint = "foobar"
Middlewares = ["foobar", "foobar"] Middlewares = ["foobar", "foobar"]
[Metrics.Datadog] [Metrics.Datadog]
Address = "foobar" Address = "foobar"
PushInterval = "foobar" PushInterval = "foobar"
[Metrics.StatsD] [Metrics.StatsD]
Address = "foobar" Address = "foobar"
PushInterval = "foobar" PushInterval = "foobar"
[Metrics.InfluxDB] [Metrics.InfluxDB]
Address = "foobar" Address = "foobar"
Protocol = "foobar" Protocol = "foobar"
@ -179,6 +209,7 @@
Backend = "foobar" Backend = "foobar"
ServiceName = "foobar" ServiceName = "foobar"
SpanNameLimit = 42 SpanNameLimit = 42
[Tracing.Jaeger] [Tracing.Jaeger]
SamplingServerURL = "foobar" SamplingServerURL = "foobar"
SamplingType = "foobar" SamplingType = "foobar"
@ -187,12 +218,14 @@
Gen128Bit = true Gen128Bit = true
Propagation = "foobar" Propagation = "foobar"
TraceContextHeaderName = "foobar" TraceContextHeaderName = "foobar"
[Tracing.Zipkin] [Tracing.Zipkin]
HTTPEndpoint = "foobar" HTTPEndpoint = "foobar"
SameSpan = true SameSpan = true
ID128Bit = true ID128Bit = true
Debug = true Debug = true
SampleRate = 42.0 SampleRate = 42.0
[Tracing.DataDog] [Tracing.DataDog]
LocalAgentHostPort = "foobar" LocalAgentHostPort = "foobar"
GlobalTag = "foobar" GlobalTag = "foobar"
@ -202,10 +235,11 @@
ParentIDHeaderName = "foobar" ParentIDHeaderName = "foobar"
SamplingPriorityHeaderName = "foobar" SamplingPriorityHeaderName = "foobar"
BagagePrefixHeaderName = "foobar" BagagePrefixHeaderName = "foobar"
[Tracing.Instana] [Tracing.Instana]
LocalAgentHost = "foobar" LocalAgentHost = "foobar"
LocalAgentPort = 42 LocalAgentPort = 42
Level = "foobar" LogLevel = "foobar"
[HostResolver] [HostResolver]
CnameFlattening = true CnameFlattening = true
@ -220,13 +254,16 @@
EntryPoint = "foobar" EntryPoint = "foobar"
KeyType = "foobar" KeyType = "foobar"
OnHostRule = true OnHostRule = true
[ACME.DNSChallenge] [ACME.DNSChallenge]
Provider = "foobar" Provider = "foobar"
DelayBeforeCheck = 42 DelayBeforeCheck = 42
Resolvers = ["foobar", "foobar"] Resolvers = ["foobar", "foobar"]
DisablePropagationCheck = true DisablePropagationCheck = true
[ACME.HTTPChallenge] [ACME.HTTPChallenge]
EntryPoint = "foobar" EntryPoint = "foobar"
[ACME.TLSChallenge] [ACME.TLSChallenge]
[[ACME.Domains]] [[ACME.Domains]]