Watch files in traefik_provider_file_directory for changes
traefik_entrypoints[]
Variable
Default
Comments
name
Required
Entrypoint name
port
Required
Entrypoint port
host
""
Host IP to listen on. Defaults to any IP
protocol
""
Protocol to listen to ("tcp" or "udp"). Defaults to unspecified (effectively "tcp")
http
{}
HTTP specific options
http.redirect.to
""
Entrypoint to redirect traffic to
traefik_providers[]
Variable
Default
Comments
type
Required
Provider type
option
""
Provider option
All provider options are supported, and will be output as specified. No default options are set for any provider - everything required by the provider type must be specified
traefik_tls_certificates[]
TLS certificates need to be installed in {{ traefik_config_dir }}/certificates
Variable
Default
Comments
cert
Required
Filename for the full certificate chain
key
Required
Filename for the private key
default
no
Set as the default certificate
traefik_routers[]
Variable
Default
Comments
name
Required
Router name
type
"http"
Router type: "http", "tcp" or "udp"
rule
Required
Rule to match
service
Required
Service to route to
entrypoints
[]
List of entrypoints to bind router definition to
create
"both"
For "http" and "tcp" router types, specifies whether to create secure ("secure"), insecure ("insecure"), or both secure and insecure ("both") router defintions. If both secure and insecure definitions are created, the same settings will be applied to both definitions.
traefik_services[]
Variable
Default
Comments
name
Required
Service name
type
"http"
Service type: "http", "tcp" or "udp"
servers
Required
List of server URLs to load balance between
Docker specific configuration
Variable
Default
Comments
traefik_docker_compose
"{{ traefik_config_dir }}"
Location for generated docker-compose.yaml
traefik_docker_service_name
"traefik"
Name of service in docker-compose.yaml
traefik_docker_networks
"{{ traefik_default_docker_networks }}"
Networks to create in docker-compose.yaml. Traefik container will be attached to all networks listed
traefik_docker_network
"traefik"
Name of default network
traefik_docker_network_driver
"bridge"
Driver type for default network
traefik_docker_network_driver_options
"{}"
Driver options for default network
traefik_docker_network_alias
"{{ traefik_docker_network }}"
"Public" name for default network
traefik_docker_socket
"/var/run/docker.sock"
Path to Docker socket. Will be bound to same path in container
traefik_provider_docker_endpoint
"unix://{{ traefik_docker_socket }}"
Endpoint for Docker provider
traefik_docker_networks[]
Variable
Default
Comments
name
Required
Internal name for the network
external
false
Network created outside of docker-compose.yaml
alias
""
"Public" name for the network
driver
""
Driver to use for the network
driver_opts
{}
Driver options for the network
Defaults
Predefined Variables
Variable
Value
Comments
traefik_provider_file_directory
"{{ traefik_config_dir }}/conf.d"
Location for dynamic configuration files
traefik_tls_certificate_dir
"{{ traefik_config_dir }}/certificates"
Location for TLS certificates
Entrypoints
Two entrypoints are defined by default, listening to all available IP addresses - an HTTP entrypoint on port 80, and a corresponding HTTPS entrypoint on port 443. The HTTP entrypoint is configured to redirect all traffic to the HTTPS entrypoint automatically.
Two providers are configured by default - a file provider, and a docker provider. These can be removed by replacing the definitions, however be aware that all the dynamic configuration files (e.g. the dashboard router, supplied traefik_tls_certificates etc.) are generated in traefik_provider_file_directory and require that a file provider pointing to that directory exists in order to be used
Current tasks/templates write each router/service/middleware as a separate file, however it is possible to combine these into a single file. There are a number of possible scenarios to potentially support:
one file per definition (as now)
one file per definition type (i.e. group routers, services, middlewares etc.)
one file per group of related definitions (i.e. a router, service and middleware(s) combination)