Hey to everyone!
I was able to achieve global redirect to https with the Dynamic config below
The problem is that i use Port Forwarding at the Firewall level for example exmaple.com:8111 will be redirected to 443 at the router level. Traefik listens on 80,443 there for it will except the Routing of exmaple.com:80/exmaple.com:443 and will handle the routing as it should. The url in the browser will show exmaple.com:8111. When using the below configuration the URL in the browser will be redirected to https without the specific port that is needed for the port Forwarding to work the proper way - therefore the website won't load. I would like the Regex to keep the original port. I think i need to change the: rule = "HostRegexp({host:.+}
)" but i can't find any good example to do it the right way.
Can someone help?
[http.routers.redirecttohttps]
entryPoints = ["web"]
middlewares = ["redirect-to-https"]
rule = "HostRegexp(`{host:.+}`)"
service = "noop"
[http.services.noop.loadBalancer]
[[http.services.noop.loadBalancer.servers]]
url = "http://localhost/"