Hello all
I want to use 2 wildcards with my traefik container. I have this config:
services:
traefik:
image: traefik:latest
restart: unless-stopped
container_name: traefik
command: --api.insecure=false --api.dashboard=true
--providers.docker.exposedByDefault=true
--serversTransport.insecureSkipVerify=true
--log.filePath="/etc/traefik/traefik.log"
--accesslog.filepath=/etc/traefik/access.log
--log.level="INFO"
--providers.file.filename=/etc/traefik/dynamic.yaml
--entryPoints.websecure.address=:443
--entryPoints.web.address=:80
--certificatesresolvers.myresolver.acme.email=${certMail}
--certificatesresolvers.myresolver.acme.storage=/etc/traefik/acme/acme.json
--certificatesresolvers.myresolver.acme.dnschallenge.provider=${certProvider}
--certificatesresolvers.myresolver.acme.dnschallenge.resolvers=${certResolver}
--certificatesresolvers.myresolver.acme.dnschallenge.delaybeforecheck=0
labels:
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
- "traefik.http.routers.traefik.tls.domains[0].main=domain1.com"
- "traefik.http.routers.traefik.tls.domains[0].sans=*.domain1.com"
- "traefik.http.routers.traefik.tls.domains[1].main=domain2.com"
- "traefik.http.routers.traefik.tls.domains[1].sans=*.domain2.com"
- "traefik.http.routers.traefik.rule=Host(`traefik.domain2.com`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
- "traefik.http.routers.http_catchall.rule=HostRegexp(`{any:.+}`)"
- "traefik.http.routers.http_catchall.entrypoints=web"
- "traefik.http.routers.http_catchall.middlewares=https_redirect"
- "traefik.http.middlewares.ipwhitelist.ipwhitelist.sourcerange=<some networks>"
- "traefik.http.routers.traefik.middlewares=ipwhitelist"
domain1.com wildcards are working as expected. domain2.com on the other site behaves strange. I have both wildcard certs within acme.json, but also named certs for each container I want to use with domain2.com.
On the container I have these labels:
labels:
- "traefik.enable=true"
- "traefik.http.routers.container1.tls=true"
- "traefik.http.routers.container1.entrypoints=websecure"
- "traefik.http.routers.container1.rule=Host(`container1.domain2.com`)"
- "traefik.http.routers.container1.tls.certresolver=myresolver"
I didn't find any documentation on this in the official documentation. I found only this reddit, where someone had the same problem:
https://www.reddit.com/r/Traefik/comments/i61cy8/multiple_letsencrypt_wildcard_certificates_on_a/
This didn't work for me. Has someone an idea what I am doing wrong?