Enable TLS for all routes by default

Using with Docker (docker-compose), with a defaultRule, I would like to enable TLS for all routes automatically (no labels for each services).

I'm looking for exactly the same thing. I tried a few tweaks but without luck. It's a shame to have to set labels just to specify the certresolver + TLS=true.

What I'm trying to do in the end is a fully automated solution to use Let's Encrypt wildcard certificate for all containers. Everything is working fine but I'm only missing this feature.

Good news ! It works now with Traefik 2.2 (RC) using the new default section on the entrypoint :tada:

Tested with this conf :

entryPoints:
  https:
    address: ":443"
    http:
      tls:
        domains:
          - main: mydomain.com

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: true
    defaultRule: "Host(`{{ trimPrefix `/` .Name }}.mydomain.com`)"
    network: "proxy"
  file:
    directory: /ssl/
    watch: true

No label needed at all on new containers, they are automatically proxied on https://%CONTAINER_NAME%.mydomain.com

1 Like