Here the configuration (With the line commented out) :
╰─# cat traefik.yml
defaultEntryPoints: ["http", "https"]
log:
level: "DEBUG"
entryPoints:
http:
address: ":80"
https:
address: ":443"
api:
dashboard: True
insecure: False
debug: True
providers:
# Enable the file provider to define routers / middlewares / services in a file
file:
filename: dynamic_conf.yml
directory: "/etc/traefik/"
docker:
exposedbydefault: true
network: "traefik_net"
#defaultRule: Host(`{{ normalize .Name }}`)
So now I restart Traefik container (with this configuration):
Debug Logs are :
time="2019-11-10T20:08:06Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
time="2019-11-10T20:08:06Z" level=info msg="Traefik version 2.0.4 built on 2019-10-28T20:23:57Z"
time="2019-11-10T20:08:06Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}},\"https\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"network\":\"traefik_net\",\"swarmModeRefreshSeconds\":15000000000},\"file\":{\"directory\":\"/etc/traefik/\",\"watch\":true,\"filename\":\"dynamic_conf.yml\"}},\"api\":{\"dashboard\":true,\"debug\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"}}"
time="2019-11-10T20:08:06Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/v2.0/contributing/data-collection/\n"
time="2019-11-10T20:08:06Z" level=debug msg="No default certificate, generating one"
time="2019-11-10T20:08:06Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
time="2019-11-10T20:08:06Z" level=debug msg="Start TCP Server" entryPointName=http
time="2019-11-10T20:08:06Z" level=info msg="Starting provider *file.Provider {\"directory\":\"/etc/traefik/\",\"watch\":true,\"filename\":\"dynamic_conf.yml\"}"
time="2019-11-10T20:08:06Z" level=debug msg="Start TCP Server" entryPointName=https
time="2019-11-10T20:08:06Z" level=error msg="Cannot start the provider *file.Provider: /etc/traefik/traefik.yml: template: dynamic_conf.yml:25:37: executing \"dynamic_conf.yml\" at <.Name>: can't evaluate field Name in type bool"
time="2019-11-10T20:08:06Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"network\":\"traefik_net\",\"swarmModeRefreshSeconds\":15000000000}"
time="2019-11-10T20:08:06Z" level=debug msg="Provider connection established with docker 19.03.4 (API 1.40)" providerName=docker
time="2019-11-10T20:08:06Z" level=warning msg="Could not find network named 'traefik_net' for container '/compose_files_portainer_1'! Maybe you're missing the project's prefix in the label? Defaulting to first available network." providerName=docker container=portainer-compose-files-531a6736d024a476a8ab23e3589881b8fa3078c786b1759d2106f79dc4c5012c serviceName=portainer-compose-files
time="2019-11-10T20:08:06Z" level=warning msg="Could not find network named 'traefik_net' for container '/ddclient'! Maybe you're missing the project's prefix in the label? Defaulting to first available network." providerName=docker container=ddclient-494287a96386ff69f81aa0327cd9c488f8ec3014d84e9f2930728b643395500a serviceName=ddclient
time="2019-11-10T20:08:06Z" level=error msg="port is missing" providerName=docker container=ddclient-494287a96386ff69f81aa0327cd9c488f8ec3014d84e9f2930728b643395500a
time="2019-11-10T20:08:06Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"portainer-compose-files\":{\"service\":\"portainer-compose-files\",\"rule\":\"Host(`portainer-compose-files`)\"},\"traefik\":{\"service\":\"traefik\",\"rule\":\"Host(`traefik`)\"},\"whoami\":{\"service\":\"whoami\",\"rule\":\"Host(`whoami.arthurgarnier.fr`)\"}},\"services\":{\"portainer-compose-files\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.2:8000\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.19.0.3:80\"}],\"passHostHeader\":true}},\"whoami\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.19.0.2:80\"}],\"passHostHeader\":true}}}},\"tcp\":{}}" providerName=docker
time="2019-11-10T20:08:06Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=whoami@docker
time="2019-11-10T20:08:06Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=portainer-compose-files@docker
time="2019-11-10T20:08:06Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=traefik@docker
time="2019-11-10T20:08:06Z" level=debug msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining entryPointName=http routerName=whoami@docker serviceName=whoami
time="2019-11-10T20:08:06Z" level=debug msg="Creating load-balancer" serviceName=whoami entryPointName=http routerName=whoami@docker
time="2019-11-10T20:08:06Z" level=debug msg="Creating server 0 http://172.19.0.2:80" serverName=0 entryPointName=http routerName=whoami@docker serviceName=whoami
time="2019-11-10T20:08:06Z" level=debug msg="Added outgoing tracing middleware whoami" entryPointName=http routerName=whoami@docker middlewareName=tracing middlewareType=TracingForwarder
time="2019-11-10T20:08:06Z" level=debug msg="Creating middleware" routerName=portainer-compose-files@docker serviceName=portainer-compose-files middlewareName=pipelining middlewareType=Pipelining entryPointName=http
time="2019-11-10T20:08:06Z" level=debug msg="Creating load-balancer" serviceName=portainer-compose-files entryPointName=http routerName=portainer-compose-files@docker
time="2019-11-10T20:08:06Z" level=debug msg="Creating server 0 http://172.18.0.2:8000" routerName=portainer-compose-files@docker serviceName=portainer-compose-files entryPointName=http serverName=0
time="2019-11-10T20:08:06Z" level=debug msg="Added outgoing tracing middleware portainer-compose-files" routerName=portainer-compose-files@docker middlewareName=tracing middlewareType=TracingForwarder entryPointName=http
time="2019-11-10T20:08:06Z" level=debug msg="Creating middleware" middlewareType=Pipelining serviceName=traefik entryPointName=http routerName=traefik@docker middlewareName=pipelining
time="2019-11-10T20:08:06Z" level=debug msg="Creating load-balancer" entryPointName=http routerName=traefik@docker serviceName=traefik
time="2019-11-10T20:08:06Z" level=debug msg="Creating server 0 http://172.19.0.3:80" entryPointName=http routerName=traefik@docker serviceName=traefik serverName=0
time="2019-11-10T20:08:06Z" level=debug msg="Added outgoing tracing middleware traefik" middlewareName=tracing entryPointName=http routerName=traefik@docker middlewareType=TracingForwarder
time="2019-11-10T20:08:06Z" level=debug msg="Creating middleware" entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2019-11-10T20:08:06Z" level=debug msg="Creating middleware" middlewareName=traefik-internal-recovery middlewareType=Recovery entryPointName=https
time="2019-11-10T20:08:06Z" level=debug msg="No default certificate, generating one"
Now I just remove the line : #defaultRule: Host({{ normalize .Name }}
)
AND NOTHING ELSE. Then restarting container :
Here the logs :
time="2019-11-10T20:10:42Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
time="2019-11-10T20:10:42Z" level=info msg="Traefik version 2.0.4 built on 2019-10-28T20:23:57Z"
time="2019-11-10T20:10:42Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}},\"https\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"network\":\"traefik_net\",\"swarmModeRefreshSeconds\":15000000000},\"file\":{\"directory\":\"/etc/traefik/\",\"watch\":true,\"filename\":\"dynamic_conf.yml\"}},\"api\":{\"dashboard\":true,\"debug\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"}}"
time="2019-11-10T20:10:42Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/v2.0/contributing/data-collection/\n"
time="2019-11-10T20:10:42Z" level=debug msg="No default certificate, generating one"
time="2019-11-10T20:10:42Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
time="2019-11-10T20:10:42Z" level=debug msg="Start TCP Server" entryPointName=http
time="2019-11-10T20:10:42Z" level=info msg="Starting provider *file.Provider {\"directory\":\"/etc/traefik/\",\"watch\":true,\"filename\":\"dynamic_conf.yml\"}"
time="2019-11-10T20:10:42Z" level=debug msg="Start TCP Server" entryPointName=https
time="2019-11-10T20:10:42Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"network\":\"traefik_net\",\"swarmModeRefreshSeconds\":15000000000}"
time="2019-11-10T20:10:42Z" level=debug msg="Configuration received from provider file: {\"http\":{\"routers\":{\"api\":{\"middlewares\":[\"dash-auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`traefik.thanos.local`)\"}},\"middlewares\":{\"dash-auth\":{\"basicAuth\":{\"users\":[\"admin:$apr1$mOYHxwBa$7KV2biA89CxJNrW8ehQ.b/\"]}},\"https-only\":{\"redirectScheme\":{\"scheme\":\"https\"}}}},\"tcp\":{},\"tls\":{}}" providerName=file
time="2019-11-10T20:10:42Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=api@file
time="2019-11-10T20:10:42Z" level=debug msg="Added outgoing tracing middleware api@internal" entryPointName=http routerName=api@file middlewareName=tracing middlewareType=TracingForwarder
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" middlewareName=dash-auth@file middlewareType=BasicAuth entryPointName=http routerName=api@file
time="2019-11-10T20:10:42Z" level=debug msg="Adding tracing to middleware" routerName=api@file entryPointName=http middlewareName=dash-auth@file
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" entryPointName=https middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2019-11-10T20:10:42Z" level=debug msg="No default certificate, generating one"
time="2019-11-10T20:10:42Z" level=debug msg="Provider connection established with docker 19.03.4 (API 1.40)" providerName=docker
time="2019-11-10T20:10:42Z" level=warning msg="Could not find network named 'traefik_net' for container '/compose_files_portainer_1'! Maybe you're missing the project's prefix in the label? Defaulting to first available network." providerName=docker serviceName=portainer-compose-files container=portainer-compose-files-531a6736d024a476a8ab23e3589881b8fa3078c786b1759d2106f79dc4c5012c
time="2019-11-10T20:10:42Z" level=warning msg="Could not find network named 'traefik_net' for container '/ddclient'! Maybe you're missing the project's prefix in the label? Defaulting to first available network." providerName=docker container=ddclient-494287a96386ff69f81aa0327cd9c488f8ec3014d84e9f2930728b643395500a serviceName=ddclient
time="2019-11-10T20:10:42Z" level=error msg="port is missing" container=ddclient-494287a96386ff69f81aa0327cd9c488f8ec3014d84e9f2930728b643395500a providerName=docker
time="2019-11-10T20:10:42Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"portainer-compose-files\":{\"service\":\"portainer-compose-files\",\"rule\":\"Host(`portainer-compose-files`)\"},\"traefik\":{\"service\":\"traefik\",\"rule\":\"Host(`traefik`)\"},\"whoami\":{\"service\":\"whoami\",\"rule\":\"Host(`whoami.arthurgarnier.fr`)\"}},\"services\":{\"portainer-compose-files\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.18.0.2:8000\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.19.0.3:80\"}],\"passHostHeader\":true}},\"whoami\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.19.0.2:80\"}],\"passHostHeader\":true}}}},\"tcp\":{}}" providerName=docker
time="2019-11-10T20:10:42Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=whoami@docker
time="2019-11-10T20:10:42Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=portainer-compose-files@docker
time="2019-11-10T20:10:42Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=traefik@docker
time="2019-11-10T20:10:42Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=api@file
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" entryPointName=https routerName=whoami@docker serviceName=whoami middlewareName=pipelining middlewareType=Pipelining
time="2019-11-10T20:10:42Z" level=debug msg="Creating load-balancer" routerName=whoami@docker serviceName=whoami entryPointName=https
time="2019-11-10T20:10:42Z" level=debug msg="Creating server 0 http://172.19.0.2:80" serverName=0 entryPointName=https routerName=whoami@docker serviceName=whoami
time="2019-11-10T20:10:42Z" level=debug msg="Added outgoing tracing middleware whoami" entryPointName=https routerName=whoami@docker middlewareName=tracing middlewareType=TracingForwarder
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" serviceName=portainer-compose-files middlewareName=pipelining middlewareType=Pipelining entryPointName=https routerName=portainer-compose-files@docker
time="2019-11-10T20:10:42Z" level=debug msg="Creating load-balancer" entryPointName=https routerName=portainer-compose-files@docker serviceName=portainer-compose-files
time="2019-11-10T20:10:42Z" level=debug msg="Creating server 0 http://172.18.0.2:8000" entryPointName=https routerName=portainer-compose-files@docker serviceName=portainer-compose-files serverName=0
time="2019-11-10T20:10:42Z" level=debug msg="Added outgoing tracing middleware portainer-compose-files" routerName=portainer-compose-files@docker middlewareName=tracing middlewareType=TracingForwarder entryPointName=https
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining entryPointName=https routerName=traefik@docker serviceName=traefik
time="2019-11-10T20:10:42Z" level=debug msg="Creating load-balancer" entryPointName=https routerName=traefik@docker serviceName=traefik
time="2019-11-10T20:10:42Z" level=debug msg="Creating server 0 http://172.19.0.3:80" serverName=0 entryPointName=https routerName=traefik@docker serviceName=traefik
time="2019-11-10T20:10:42Z" level=debug msg="Added outgoing tracing middleware traefik" entryPointName=https routerName=traefik@docker middlewareName=tracing middlewareType=TracingForwarder
time="2019-11-10T20:10:42Z" level=debug msg="Added outgoing tracing middleware api@internal" middlewareName=tracing middlewareType=TracingForwarder entryPointName=https routerName=api@file
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" entryPointName=https routerName=api@file middlewareName=dash-auth@file middlewareType=BasicAuth
time="2019-11-10T20:10:42Z" level=debug msg="Adding tracing to middleware" middlewareName=dash-auth@file entryPointName=https routerName=api@file
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" entryPointName=https middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2019-11-10T20:10:42Z" level=debug msg="Creating middleware" middlewareType=Recovery middlewareName=traefik-internal-recovery entryPointName=http
time="2019-11-10T20:10:42Z" level=debug msg="No default certificate, generating one"
time="2019-11-10T20:10:45Z" level=debug msg="Authentication succeeded" middlewareName=dash-auth@file middlewareType=BasicAuth
Note that recreating or restarting the container give the same result...