Restrict traefik.toml to static configuration.
This commit is contained in:
parent
f49800e56a
commit
093658836e
78 changed files with 274 additions and 440 deletions
|
@ -6,7 +6,6 @@ Good Old Configuration File
|
|||
The file provider lets you define the [dynamic configuration](./overview.md) in a TOML or YAML file.
|
||||
You can write these configuration elements:
|
||||
|
||||
* At the end of the main Traefik configuration file (by default: `traefik.toml`/`traefik.yml`/`traefik.yaml`).
|
||||
* In [a dedicated file](#filename)
|
||||
* In [several dedicated files](#directory)
|
||||
|
||||
|
@ -22,13 +21,19 @@ You can write these configuration elements:
|
|||
|
||||
Enabling the file provider:
|
||||
|
||||
```toml tab="TOML"
|
||||
```toml tab="File (TOML)"
|
||||
[providers.file]
|
||||
filename = "/my/path/to/dynamic-conf.toml"
|
||||
```
|
||||
|
||||
```yaml tab="YAML"
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
file: {}
|
||||
file:
|
||||
filename: "/my/path/to/dynamic-conf.yml"
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.file.filename=/my/path/to/dynamic_conf.toml
|
||||
```
|
||||
|
||||
Declaring Routers, Middlewares & Services:
|
||||
|
@ -102,16 +107,20 @@ _Optional_
|
|||
|
||||
Defines the path of the configuration file.
|
||||
|
||||
```toml tab="TOML"
|
||||
```toml tab="File (TOML)"
|
||||
[providers]
|
||||
[providers.file]
|
||||
filename = "rules.toml"
|
||||
filename = "dynamic_conf.toml"
|
||||
```
|
||||
|
||||
```yaml tab="YAML"
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
file:
|
||||
filename: rules.yaml
|
||||
filename: dynamic_conf.yml
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.file.filename=dynamic_conf.toml
|
||||
```
|
||||
|
||||
### `directory`
|
||||
|
@ -120,18 +129,22 @@ _Optional_
|
|||
|
||||
Defines the directory that contains the configuration files.
|
||||
|
||||
```toml tab="TOML"
|
||||
```toml tab="File (TOML)"
|
||||
[providers]
|
||||
[providers.file]
|
||||
directory = "/path/to/config"
|
||||
```
|
||||
|
||||
```yaml tab="YAML"
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
file:
|
||||
directory: /path/to/config
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.file.directory=/path/to/config
|
||||
```
|
||||
|
||||
### `watch`
|
||||
|
||||
_Optional_
|
||||
|
@ -139,20 +152,25 @@ _Optional_
|
|||
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.
|
||||
|
||||
```toml tab="TOML"
|
||||
```toml tab="File (TOML)"
|
||||
[providers]
|
||||
[providers.file]
|
||||
filename = "rules.toml"
|
||||
filename = "dynamic_conf.toml"
|
||||
watch = true
|
||||
```
|
||||
|
||||
```yaml tab="YAML"
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
file:
|
||||
filename: rules.yml
|
||||
filename: dynamic_conf.yml
|
||||
watch: true
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.file.filename=dynamic_conf.toml
|
||||
--providers.file.watch=true
|
||||
```
|
||||
|
||||
### Go Templating
|
||||
|
||||
!!! warning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue