Configuration Introduction
Configuration in Traefik can refer to two different things:
- The startup configuration (referred to as the static configuration)
Elements in the static configuration set up connections to providers and define the Traefik will listen to (these elements don't change often).
The dynamic configuration contains everything that defines how the requests are handled by your system.This configuration can change and is seamlessly hot-reloaded, without any request interruption or connection loss.
Incompatible Configuration
Please be aware that the old configurations for Traefik v1.x are NOT compatible with the v2.x config as of now.If you are running v2, please ensure you are using a v2 configuration.
Since this configuration is specific to your infrastructure choices, we invite you to refer to the dedicated section of this documentation.
In the , the dynamic configuration comes from docker in the form of labels attached to your containers.
HTTPS Certificates also belong to the dynamic configuration.
You can add / update / remove them without restarting your Traefik instance.
There are three different, mutually exclusive (e.g. you can use only one at the same time), ways to define static configuration options in Traefik:
- In a configuration file
- In the command-line arguments
- As environment variablesThese ways are evaluated in the order listed above.
If no value was provided for a given option, a default value applies.Moreover, if an option has sub-options, and any of these sub-options is not specified, a default value will apply as well.
At startup, Traefik searches for a file named traefik.toml
(or traefik.yml
or ) in:
/etc/traefik/
$XDG_CONFIG_HOME/
.
(the working directory).
You can override this using the argument.
To get the list of all available arguments:
traefik --help
# or
All available arguments can also be found here.
All available environment variables can be found
All the configuration options are documented in their related section.