From 69269341da72fda867c2e8cc601cd46ddeca1d12 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Tue, 19 Nov 2024 06:58:03 +0100 Subject: [PATCH] add redirects for chaos-west.tv misspelling --- modules/swarm/cwtv-web/main.tf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 } }