I think the redirect must go into the dynamic configuration, not the static one. But yes, you can setup a generic redirect. I did it like this:
http:
routers:
redirect-https:
rule: HostRegexp(`{catchall:.*}`)
entrypoints: web
middlewares: redirect-https
service: dummy
services:
dummy:
loadbalancer:
servers:
- url: "about:blank"
This is in a file 010-redirect-https.yml
in my Traefik's dynamic configuration directory. And it works for all http URLs.
Exactly! It didn't work without providing any service item, so I had to specify something.
I use the dynamic configuration to add some static routes to other devices and non-Docker services in my local network.