The dynamic configuration allows to defines the TLS configuration and the redirect middleware that are usable by all other providers as redirect@file (the name@provider).
To avoid repeating the label traefik.http.routers.XXX.rule=Host(`whoami.docker.localhost`) on each docker service on the future, you might want to look for the new defaultrule: - --providers.docker.defaultrule=Host(`{{ .Name }}.example.com`) to define a default rule to apply to all routers without specific rule.
To have more details on the configuration and the mechanism, I encourage you to read some related documentation :
Thanks! I think I unfairly created a two part question - One aspect is indeed figuring out how to solve that scenario (perfect, thank-you) - the other is how to better represent migration between versions in the documentation. i.e. an upgrade guide, or something. This second aspect is specifically because I'd already thoroughly read through all the docs you recommended prior to asking the question.
However that doesn't seem to be the appropriate primitive which makes sense as we're already in the file. How do I reference the "middlewares" without having given it a name?
I'm also referencing this using a Docker provider and tags, which works fine. I'd like to use both static and dynamic configuration across the common redirect middleware.
EDIT
This actually works. I had an error in my entrypoint for the non-https router.
Concerning the configuration you provided, the name of the middleware is missing.
You can found a sample in the redirectScheme documentation, it should be something like:
I'm not sure to understand the point on static and dynamic configuration. The configuration of middlewares and routers is dynamic whether it is in a file or in labels.