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 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 06:55:56 +00:00
co-authored by Claude Opus 4.8
parent 81745dee4b
commit 48ed88cc8d
+28
View File
@@ -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.