Using certresolver over default stored certificate

Hey,

I have set a default certificate with the following method in my traefik.yml.

tls:
  stores:
    default:
      defaultCertificate:
        certFile: path/to/cert.crt
        keyFile: path/to/cert.key

Now I want to overwrite this certificate for some domains. So I tried this in my config.yml file.

http:
  #region routers
  routers:
    plex:
      entryPoints:
        - web
        - websecure
      rule: "Host(`plex.example.tk`)"
      middlewares:
        - authelia
      tls:
        certResolver: staging
      service: plex

Still, the default certificate is used. When the default certificate section is commented, it switches to my certresolver.

Any idea to make them both work?

Works for me, we have custom TLS and some services using LetsEncrypt.

You need to define the certificatesResolvers in your static config (like providers and entrypoints), and put both TLS and HTTP into a dynamic configuration. Dynamic config files can be loaded with provider.file in the static config.

A good idea is always to enable Traefik debug logging and check the log file for errors.

Thanks for the response.

I had placed my defaultCertificate in the static config. After moving this to the dynamic one everything works!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.