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:
@@ -102,6 +102,20 @@ spec:
|
|||||||
targetPort: 2368
|
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
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@@ -110,6 +124,9 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
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:
|
spec:
|
||||||
ingressClassName: traefik
|
ingressClassName: traefik
|
||||||
rules:
|
rules:
|
||||||
@@ -123,9 +140,20 @@ spec:
|
|||||||
name: zona-exclusion
|
name: zona-exclusion
|
||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
|
- host: www.zonadeexclusion.com
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: zona-exclusion
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- zonadeexclusion.com
|
- zonadeexclusion.com
|
||||||
|
- www.zonadeexclusion.com
|
||||||
secretName: zona-exclusion-tls
|
secretName: zona-exclusion-tls
|
||||||
|
|
||||||
# Secret gestionado manualmente — NO añadir aquí para evitar que ArgoCD sobreescriba.
|
# Secret gestionado manualmente — NO añadir aquí para evitar que ArgoCD sobreescriba.
|
||||||
|
|||||||
Reference in New Issue
Block a user