Hello @cakiwi,
You have a very good topic on redirect and it think it is nearly the same problem as me.
Basically in my setup I have a server running podman (very similar do docker)
The containers all exist in a private internal network and I have only exposed port 80 and 443 to the outside from traefik.
The issue I have is when i type "https://server.domain/phabricator/" traefik picks it up but redirects to "https://phabricator-app.dns.podman:8443/"
However I just wanted it to do reverse proxy, it would fetch https://phabricator-app.dns.podman:8443/ which is only accesible from traefik and present it under https://server.domain/phabricator/
I was wondering if you could help me understand what is wrong, i am not sure i am using the middlewares correctly.
Thanks
static conf (traefik.toml)
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.forwardedHeaders]
insecure = true
[entryPoints.https]
[api]
insecure = true
dashboard = true
[providers]
[providers.file]
directory = "/etc/traefik/conf"
watch = true
[entryPoints]
# Standard HTTP
[entryPoints.http]
address = ":80"
[entryPoints.http.forwardedHeaders]
insecure = true
# Standard HTTPS
[entryPoints.https]
address = ":443"
## To allow reverse proxy between ssl
[serversTransport]
insecureSkipVerify = true
this is my dynamic conf
## Global redirect
[http.routers]
[http.routers.redirecttohttps]
## Redirects everything to https
entryPoints = ["http"]
tls = true
middlewares = ["httpsredirect"]
rule = "HostRegexp(`{host:.+}`)"
service = "noop"
[http.routers.routephabricator]
entryPoints = ["https"]
tls = true
rule = "PathPrefix(`/phabricator{regex:$$|/.*}`)"
middlewares = ["redirectregex-phabricator"]
# middlewares = ["https-headers"]
service = "phabricator-app"
[http.services]
[http.services.phabricator-app.loadBalancer]
[[http.services.phabricator-app.loadBalancer.servers]]
url = "https://phabricator-app.dns.podman:8443/"
[http.middlewares]
[http.middlewares.httpsredirect.redirectScheme]
scheme = "https"
permanent = true
[http.middlewares.redirectregex-phabricator.redirectRegex]
regex = ".*"
replacement = "https://phabricator-app.dns.podman:8443/"
permanent = true
[tls.stores]
[tls.stores.default]
[tls.stores.default.defaultCertificate]
certFile = "/etc/traefik/cert.crt"
keyFile = "/etc/traefik/priv.key"