From 48ed88cc8d0ae67361425dd7b9ed253469aeb8d7 Mon Sep 17 00:00:00 2001 From: chemavx Date: Tue, 23 Jun 2026 06:55:56 +0000 Subject: [PATCH] zona-exclusion: serve www + 301 redirect to apex, add www to TLS SAN Adds www.zonadeexclusion.com to the Ingress (rules + tls hosts) so cert-manager re-issues zona-exclusion-tls covering apex + www via HTTP-01, and a Traefik redirectRegex Middleware that 301s www -> apex (ES canonical = apex). Mirrors the EN redirect-to-www-https middleware, inverted. DNS for www was fixed in Phase 1 (stale explicit A removed; now resolves via the favonia wildcard). Co-Authored-By: Claude Opus 4.8 --- zona-exclusion/deployment.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/zona-exclusion/deployment.yaml b/zona-exclusion/deployment.yaml index b92c1dc..7c94356 100644 --- a/zona-exclusion/deployment.yaml +++ b/zona-exclusion/deployment.yaml @@ -102,6 +102,20 @@ spec: targetPort: 2368 --- +# www -> apex (canonical) 301 redirect. Mirrors EN's redirect-to-www-https, +# INVERTED: ES canonical is the APEX. The regex matches only the www host, so +# the apex router (created from the same Ingress) is a no-op and serves normally. +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-www-to-apex + namespace: zona-exclusion +spec: + redirectRegex: + permanent: true + regex: ^https?://www\.zonadeexclusion\.com/(.*) + replacement: https://zonadeexclusion.com/${1} +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -110,6 +124,9 @@ metadata: annotations: cert-manager.io/cluster-issuer: letsencrypt-prod traefik.ingress.kubernetes.io/router.entrypoints: websecure + # Applied to all routers from this Ingress; the regex no-ops on the apex, + # so only www.zonadeexclusion.com is 301'd to the apex. + traefik.ingress.kubernetes.io/router.middlewares: zona-exclusion-redirect-www-to-apex@kubernetescrd spec: ingressClassName: traefik rules: @@ -123,9 +140,20 @@ spec: name: zona-exclusion port: number: 80 + - host: www.zonadeexclusion.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: zona-exclusion + port: + number: 80 tls: - hosts: - zonadeexclusion.com + - www.zonadeexclusion.com secretName: zona-exclusion-tls # Secret gestionado manualmente — NO añadir aquí para evitar que ArgoCD sobreescriba.