From f070dcfade5032a70095cd33a0f1c58a5599b30f Mon Sep 17 00:00:00 2001 From: Thibault Raquet Date: Tue, 9 Jul 2024 14:25:05 +0000 Subject: [PATCH] Update middlewares --- infrastructure/traefik/helm-release.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/infrastructure/traefik/helm-release.yaml b/infrastructure/traefik/helm-release.yaml index fd8945c..0d621fc 100644 --- a/infrastructure/traefik/helm-release.yaml +++ b/infrastructure/traefik/helm-release.yaml @@ -139,23 +139,35 @@ spec: # How to modify the URL to have the new target URL replacement: "https://www.${1}" - # Empty middleware for staging + # Redirection from www to domain for staging - apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent kind: Middleware metadata: name: redirect-no-www-to-www namespace: staging spec: - retry: + redirectRegex: + # Apply a permanent redirection (HTTP 301) + permanent: true + # The regular expression to match and capture elements from the request URL + regex: "^https?://www\\.(.+)" + # How to modify the URL to have the new target URL + replacement: "https://${1}" - # Empty middleware for review + # Redirection from www to domain for review - apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent kind: Middleware metadata: name: redirect-no-www-to-www namespace: review spec: - retry: + redirectRegex: + # Apply a permanent redirection (HTTP 301) + permanent: true + # The regular expression to match and capture elements from the request URL + regex: "^https?://www\\.(.+)" + # How to modify the URL to have the new target URL + replacement: "https://${1}" - apiVersion: traefik.io/v1alpha1 kind: MiddlewareTCP