Traefik with multiple domains and Cloudflare origin certificate: "tls: unknown certificate authority" error

276 Views Asked by At

I've set up Traefik and it proxies most of my containers on mymaindomain.com. However, there are a couple other containers that need to be available on their own TLD. All 3 are behind Cloudflare, set to Strict SSL and using Cloudflare Origin Certificates. I've saved the pem and key files in traefik/certs and have listed them in the dynamic config like this:

tls:
  certificates:
    - certfile: certs/mymaindomain.com.pem
      keyfile: certs/mymaindomain.com.key
    - certfile: certs/myseconddomain.com.pem
      keyfile: certs/myseconddomain.com.key

The container in question uses the following labels:

traefik.enable=true
traefik.http.routers.myseconddomain.entrypoints=http
traefik.http.routers.myseconddomain.rule=Host(`myseconddomain.com`)
traefik.http.middlewares.myseconddomain-https-redirect.redirectscheme.scheme=https
traefik.http.routers.myseconddomain.middlewares=myseconddomain-https-redirect
traefik.http.routers.myseconddomain-secure.entrypoints=https
traefik.http.routers.myseconddomain-secure.rule=Host(`myseconddomain.com`)
traefik.http.routers.myseconddomain-secure.tls=true
traefik.http.routers.myseconddomain-secure.tls.domains.main=myseconddomain.com
traefik.http.routers.myseconddomain-secure.service=myseconddomain
traefik.http.services.myseconddomain.loadbalancer.server.port=3000
traefik.docker.network=unraidnetwork

However, when I try to access it on myseconddomain.com, I get an Unvalid SSL Certificate error and Traefik says http: TLS handshake error from 162.158.19.166:61560: remote error: tls: unknown certificate authority.

Any ideas what I'm doing wrong, please?

0

There are 0 best solutions below