When I include --providers.docker.exposedbydefault=false in commands, the https redirection does not work (even when traefik.enable=true is included in my container's labels). When I set providers.docker.exposedbydefault to true, redirection works as expected.
How can I make it so I can specify --providers.docker.exposedbydefault=false and redirection works. I want to be able to control which containers are enabled in traefik using traefik.enable=true.
Thanks for the reply! You are right. Setting "traefik.enable=true" on the traefik container fixed the issue. What is the reason for needing the "traefik.enable=true" label on the traefik container? I know it's needed for sure on the application containers but didn't know the traefik container needed it as well. I played with it a bit more and noticed that if I put the redirect configuration in the dynamic file, then the "traefik.enable=true" label is not needed for https redirection to work. This is the config I tried in the dynamic file:
"traefik.enable=true" is a label that instructs traefik to process other docker labels and create configuration from them (or default one if no other labels) accordingly. This is a provider specific concept, namely docker provider. You do not need the label if you do not use --providers.docker.exposedbydefault=false because in this case by default the labels are processed and dynamic configuration is created for all containers.
In your last example you are using file provider, not docker provider, so naturally "traefik.enable=true" is irrelevant in this case.