Traefik v1 would let me configure certificates and http-to-https redirects globally in traefik.toml
:
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
permanent = true
[entryPoints.https]
address = ":443"
[acme]
# ...
[[acme.domains]]
main = "*.example.com"
sans = ["example.com"]
The Docker service itself didn't have to care about this at all:
services:
myservice:
networks:
- traefik
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.port=80
- traefik.frontend.rule=Host:myservice.example.com
With Traefik v2, it looks like I have to configure certificates per service, so I have to replicate certificate configuration (the last three lines) for every service:
services:
myservice:
networks:
- traefik
labels:
- traefik.enable=true
- traefik.http.routers.myservice.rule=Host(`myservice.example.com`)
- traefik.http.routers.myservice.entrypoints=https
- traefik.http.routers.myservice.tls.certresolver=letsencrypt
- traefik.http.routers.myservice.tls.domains[0].main=example.com
- traefik.http.routers.myservice.tls.domains[0].sans=*.example.com
Is there some way to make it work more like v1 again?