A traefik label like traefik.http.routers.<router_name>.rule
complies with a structure of
[Docker Service].[Protocol].[Traefik Configuration].[User Defined Name for Config].[Option]
A option of rule just means we are tying a rule to the router, e.g.:
traefik.http.routers.whoami.rule=Host(`whoami.localhost`)
or in an equivalent way:
traefik.http.routers.whoami.rule=Host(\"whoami.localhost\")
Traefik creates, for each container, a corresponding service and router. The service automatically gets a server per instance of the container, and the router automatically gets a rule defined by defaultRule (if no rule for it was defined in labels).
More examples of router configuration with labels:
traefik.http.routers.<router_name>.rule:traefik.http.routers.myrouter.rule=Host(`example.com`) traefik.http.routers.<router_name>.entrypoints:traefik.http.routers.myrouter.entrypoints=ep1,ep2 traefik.http.routers.<router_name>.service:traefik.http.routers.myrouter.service=myservice traefik.http.routers.<router_name>.tls:traefik.http.routers.myrouter.tls=true Examples of Service configuration with labels:
traefik.http.services.<service_name>.loadbalancer.server.port:traefik.http.services.myservice.loadbalancer.server.port=8080traefik.http.services.<service_name>.loadbalancer.passhostheader:traefik.http.services.myservice.loadbalancer.server.passhostheader=truetraefik.http.services.<service_name>.loadbalancer.healthcheck.path:traefik.http.services.myservice.loadbalancer.server.healthcheck.path=/footraefik.http.services.<service_name>.loadbalancer.healthcheck.port:traefik.http.services.myservice.loadbalancer.healthcheck.port=42Docker specific options:
traefik.enabletraefik.docker.network
overrides the default network used by TraefikDNS providers which traefik can handle
Three ways for traefik to proceed with certificates:
Three ways for Let's Encrypt to validate you control the domain name with challenges: