Hi!
My Traefik setup was working perfectly.
And then all of a sudden Traefik started serving not the certificates it requested via cloudflare/let's encrypt but the fallback Traefik one.
I setup Traefik completely new to try it from scratch, but I am getting the same results. Does anybody have an idea what I am doing wrong? And don't wonder why I put docker as a provider into the traefik.yml I am planning on letting it auto discover everything again once it serves the right certificate. The result is the same with the file and docker.
This is my docker compose:
services:
traefik:
image: traefik:v3.7
container_name: traefik
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "8080:8080"
environment:
- CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml:ro
- ./acme.json:/etc/traefik/acme.json
- ./file.yml:/etc/traefik/dynamic/file.yml:ro
networks:
- my-bridge
networks:
my-bridge:
external: true
this is my traefik.yml:
api:
dashboard: true
insecure: true
providers:
docker:
exposedByDefault: false
network: my-bridge
file:
directory: /etc/traefik/dynamic
watch: true
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
log:
level: DEBUG
certificatesResolvers:
cloudflare:
acme:
email: example@example.com #my own
storage: /etc/traefik/acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
For simplicity I created a file.yml:
http:
routers:
portainer-https:
rule: "Host(docker.example.com)"
entryPoints:
- websecure
tls:
certResolver: cloudflare
service: portainer
services:
portainer:
loadBalancer:
servers:
- url: "http://portainer:9000"
When I start the container everything works, but when I run this I am getting TRAEFIK DEFAULT CERT:
openssl s_client -connect docker.example:443 -servername docker.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
subject=CN = TRAEFIK DEFAULT CERT
issuer=CN = TRAEFIK DEFAULT CERT
notBefore=Jul 9 01:00:39 2026 GMT
notAfter=Jul 9 01:00:39 2027 GMT
This is what is currently running on my traefik:
{
"routers":{
"api@internal":{
"entryPoints":[
"traefik"
],
"service":"api@internal",
"rule":"PathPrefix(`/api`)",
"ruleSyntax":"default",
"priority":9223372036854775806,
"observability":{
"accessLogs":true,
"metrics":true,
"tracing":true,
"traceVerbosity":"minimal"
},
"status":"enabled",
"using":[
"traefik"
]
},
"dashboard@internal":{
"entryPoints":[
"traefik"
],
"middlewares":[
"dashboard_redirect@internal",
"dashboard_stripprefix@internal"
],
"service":"dashboard@internal",
"rule":"PathPrefix(`/`)",
"ruleSyntax":"default",
"priority":9223372036854775805,
"observability":{
"accessLogs":true,
"metrics":true,
"tracing":true,
"traceVerbosity":"minimal"
},
"status":"enabled",
"using":[
"traefik"
]
},
"portainer-https@file":{
"entryPoints":[
"websecure"
],
"service":"portainer",
"rule":"Host(`docker.example.com`)",
"priority":26,
"tls":{
"options":"default",
"certResolver":"cloudflare"
},
"observability":{
"accessLogs":true,
"metrics":true,
"tracing":true,
"traceVerbosity":"minimal"
},
"status":"enabled",
"using":[
"websecure"
]
}
},
"middlewares":{
"dashboard_redirect@internal":{
"redirectRegex":{
"regex":"^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$",
"replacement":"${1}/dashboard/",
"permanent":true
},
"status":"enabled",
"usedBy":[
"dashboard@internal"
]
},
"dashboard_stripprefix@internal":{
"stripPrefix":{
"prefixes":[
"/dashboard/",
"/dashboard"
]
},
"status":"enabled",
"usedBy":[
"dashboard@internal"
]
}
},
"services":{
"api@internal":{
"status":"enabled",
"usedBy":[
"api@internal"
]
},
"dashboard@internal":{
"status":"enabled",
"usedBy":[
"dashboard@internal"
]
},
"noop@internal":{
"status":"enabled"
},
"portainer@file":{
"loadBalancer":{
"servers":[
{
"url":"http://portainer:9000"
}
],
"strategy":"wrr",
"passHostHeader":true,
"responseForwarding":{
"flushInterval":"100ms"
}
},
"status":"enabled",
"usedBy":[
"portainer-https@file"
],
"serverStatus":{
"http://portainer:9000":"UP"
}
}
}
}
I can provide the sanitized debug logs, but I currently don't know how to put them in here because of the char limit.