Exemple de configuration TOML pour redirection de domaine complet avec Traefik
Basé sur notre configuration Traefik basique Simple Traefik docker-compose setup with Lets Encrypt Cloudflare DNS-01 & TLS-ALPN-01 & HTTP-01 challenges, voici une configuration TOML complète pour rediriger my.olddomain.com vers my.newdomain.com, avec my.olddomain.com servi en utilisant un certificat Let’s Encrypt avec wildcard (*.olddomain.com) et le challenge DNS-01.
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" # cible factice pour satisfaire TraefikCheck 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