I've been trying to figure this out for the last 10 days, but I can't fix this for some reason.
Traefik correctly generates certificates through let's encrypt but never applies them to the router.
I get an output .json file with all the correct certificates inside and I get no errors at all in the logs.
I enabled web/http for testing purposes, but I did try leaving only websecure/https. The reason for this is because leaving websecure only enabled HSTS so I couldn't test if the routing to the service was correct. Enabling web/http disabled HSTS and I was able to confirm that the routing was correct, I just forgot to disable it after the fact.
Using websecure/https only gives me the same result.
Also the example you sent me is harder for me to correctly understand because it is a docker-compose example and I do not understand docker-compose well, hence why I use docker run and .yaml files.
time="2024-01-29T07:25:50Z" level=error msg="Error while creating certificate store: unable to find certificate for domains \"ptse.host\": falling back to the internal generated certificate" tlsStoreName=default
It works because I'm running it on my old TrueNAS server which uses Kubernetes. The goal is to make Traefik work on my new server which uses Docker run + .yaml config so I can get rid of the old server as I'm converting my TrueNAS servers to Archlinux.
Basically all the Traffic is going through server #1, which works.
But I'm trying to upgrade Server #1 from TrueNAS to Arch, which will require me to reconfig.
So I took Server #2, which is already running arch, to test a new config for Traefik. This is the instance that does not apply certificates. If I disable the 80 / 443 port foward on server 1 and enable server 2's I get CN=TRAEFIK DEFAULT CERT along with a HSTS error.
msg="Adding certificate for domain(s) dl.ptse.host"
No ACME certificate generation required for domains [\"dl.ptse.host\"]."
[because you already have one]
There is only one domain you have been trying too hard:
domains \"archive.ptse.host\": unable to generate a certificate for the domains [archive.ptse.host]: acme: error: 429 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rateLimited :: Error creating new order :: too many certificates (5) already issued for this exact set of domains in the last 168 hours: archive.ptse.host, retry after 2024-01-29T11:36:13Z: see https://letsencrypt.org/docs/duplicate-certificate-limit/"
With your Live system in between and you switching back and forth, there are too many things that can break.
I would start new with a fresh minimal Traefik setup and a simple whoami service, run it externally on ports 8080 and 8443, with dnsChallenge you don’t need ports 80+443.
Sorry, I can only provide a minimal setup in compose command and with labels (link). But you could try to run this with your dnsChallenge.
I don't see how it can break, it's simply redirecting to another server instead of the first one (basically you disable the port foward on the first to enable the second) so the second server redirects the traffic to the exact same services.