Certificates ssl static

I am trying to place static SSL from my domain registrar to Traefik, but Traefik gives me an error that it cannot find "domain" resolver and in the end it uses the default SSL

What should I modify in my configuration?

####################### traefik.yaml ############################
log:
level: "DEBUG"
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
providers:
docker:
exposedByDefault: false
watch: true
api:
insecure: true
dashboard: true
tls:
stores:
domain:
defaultCertificate:
certFile: "/certs/domain.cert"
keyFile: "/certs/private.key"

################## traefil.yml ##################################

version: '3.3'

services:
traefik:
image: "traefik:v2.7"
command:
- "--configFile=/etc/traefik/traefik.yaml"
ports:
- "80:80"
- "443:443"
- "8080:8080"
networks:
- net
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik.yaml:/etc/traefik/traefik.yaml"
- "./certs:/certs"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(traefik.domain.com)" # domain example
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls=true"
- "traefik.http.routers.api.tls.certresolver=domain"
networks:
net:
external: true

Use 3 backticks in front and after code/config (or selet and use </> button) to make it more readable and preserve spacing, which is important in YAML.

Note that a certResolver is used to generate LetsEncrypt TLS certs, it's not needed if you have TLS files, then you only need to set tls=true on entrypoint or router.

Loading TLS files needs to be handled in a Traefik dynamic config file, which is loaded via providers.file in static config.

What would the yaml configuration look like? Do you have any examples?

It’s all in the doc:

# Dynamic configuration

tls:
  certificates:
    - certFile: /path/to/domain.cert
      keyFile: /path/to/domain.key
    - certFile: /path/to/other-domain.cert
      keyFile: /path/to/other-domain.key

And the doc about Traefic static and dynamic config.

And what changes would there be in the labels and command? I think in the command only configuration the provider file is added and the labels would be different.

Let’s start with

Use 3 backticks in front and after code/config (or selet and use </> button) to make it more readable and preserve spacing, which is important in YAML.