1
0
Fork 0

Adds a reference to the middleware overview.

This commit is contained in:
Ludovic Fernandez 2019-04-29 19:36:07 +02:00 committed by Traefiker Bot
parent 21dec70971
commit 4b5c3ccf58
5 changed files with 29 additions and 7 deletions

View file

@ -182,7 +182,7 @@ This option can be overridden on a container basis with the `traefik.docker.netw
### `defaultRule`
_Optional, Default=Host(`{{ normalize .Name }}`)_
_Optional, Default=```Host(`{{ normalize .Name }}`)```_
For a given container if no routing rule was defined by a label, it is defined by this defaultRule instead.
It must be a valid [Go template](https://golang.org/pkg/text/template/),
@ -190,8 +190,15 @@ augmented with the [sprig template functions](http://masterminds.github.io/sprig
The container service name can be accessed as the `Name` identifier,
and the template has access to all the labels defined on this container.
```toml
defaultRule = "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
```toml tab="File"
[docker]
defaultRule = ""
# ...
```
```txt tab="CLI"
--providers.docker
--providers.docker.defaultRule="Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
```
### `swarmMode`
@ -246,6 +253,8 @@ You can declare pieces of middleware using labels starting with `traefik.http.mi
If you declare multiple middleware with the same name but with different parameters, the middleware fails to be declared.
More information about available middlewares in the dedicated [middlewares section](../middlewares/overview.md).
### TCP
You can declare TCP Routers and/or Services using labels.