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