Hey, I tried the solution from this topic in Traefik v3.0, but I can't get it to work in all cases (and from what I see, that issue is reported even in that older topic).
I'm trying to configure all this in docker-compose.yml (docker labels).
I don't think we understand each other.
What I'm trying to achieve (those 3 points from the original post) should all be defined in docker-compose.yml which should just spin up Traefik. I have other docker-compose.ymls for different services/websites, but I want all redirects to happen in Traefik's definition.
You can create a http-to-https redirect directly on entrypoint (doc).
You can assign a www redirect middleware directly on entrypoint (doc), but you need to use providers.file to read it from an extra dynamic config file.
I guess --entryPoints.websecure.http.middlewares=mymiddleware@docker should work too, not only --entryPoints.websecure.http.middlewares=mymiddleware@file, no ?
It should work. Personally I am hesitant to use a dynamic middleware assignment in static config, as there will always be a delay for loading the middleware from Docker configuration.