diff --git a/modules/swarm/cwtv-web/main.tf b/modules/swarm/cwtv-web/main.tf index 21498eb..0c5cd46 100644 --- a/modules/swarm/cwtv-web/main.tf +++ b/modules/swarm/cwtv-web/main.tf @@ -8,12 +8,15 @@ data "docker_network" "traefik" { locals { labels = { - "shepherd.auto-update" = "true", - "traefik.enable" = "true" - "traefik.http.services.cwtv-web.loadbalancer.server.port" = "80", - "traefik.http.routers.cwtv-web.rule" = "Host(`www.chaoswest.tv`)||Host(`chaoswest.tv`)", - "traefik.http.routers.cwtv-web.tls" = "true", - "traefik.http.routers.cwtv-web.tls.certresolver" = "default", + "shepherd.auto-update" = "true", + "traefik.enable" = "true" + "traefik.http.services.cwtv-web.loadbalancer.server.port" = "80", + "traefik.http.routers.cwtv-web.rule" = "Host(`www.chaoswest.tv`)||Host(`chaoswest.tv`)||Host(`chaos-west.tv`)||Host(`www.chaos-west.tv`)", + "traefik.http.routers.cwtv-web.tls" = "true", + "traefik.http.routers.cwtv-web.tls.certresolver" = "default", + "traefik.http.routers.cwtv-web.middlewares" = "cwtv-web-redirect", + "traefik.http.middlewares.cwtv-web-redirect.redirectregex.regex" = "^https://.*(\\.)?chaos-west\\.tv/(.*)", # double escaping is necessary here + "traefik.http.middlewares.cwtv-web-redirect.redirectregex.replacement" = "https://chaoswest.tv/$${2}", # double escaping is necessary here } }