Traefik vollständige Domain-Weiterleitung TOML-Konfigurationsbeispiel
Basierend auf unserer grundlegenden Traefik-Konfiguration Simple Traefik docker-compose setup with Lets Encrypt Cloudflare DNS-01 & TLS-ALPN-01 & HTTP-01 challenges ist dies eine vollständige TOML-Konfiguration, um my.olddomain.com zu my.newdomain.com weiterzuleiten, wobei my.olddomain.com mit einem Let’s-Encrypt-Zertifikat mit Wildcard (*.olddomain.com) und der DNS-01-Challenge bedient wird.
myredirect.toml
[http.routers]
[http.routers.RedictMyOlddomain]
rule = "Host(`my.olddomain.com`)"
entryPoints = ["websecure"]
middlewares = ["RedictMyOlddomain"]
service = "noop"
[http.routers.RedictMyOlddomain.tls]
certResolver = "cloudflare-ec384"
[[http.routers.RedictMyOlddomain.tls.domains]]
main = "olddomain.com"
sans = ["*.olddomain.com"]
[http.middlewares]
[http.middlewares.RedictMyOlddomain.redirectRegex]
regex = "https?://my\\.olddomain\\.com/(.*)"
replacement = "https://my.newdomain.com/$1"
permanent = true
[http.services]
[http.services.noop.loadBalancer]
[[http.services.noop.loadBalancer.servers]]
url = "http://127.0.0.1" # dummy target to make Traefik happyCheck out similar posts by category:
Traefik
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow