A router with TLS enabled (from the Ingress tls section) never matches on the plain web entrypoint, so entrypoints web,websecure on the Ingress itself still 404'd on :80. Keep the Ingress on websecure only and add an IngressRoute on web with the redirect-https middleware. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]>
22 lines
623 B
YAML
22 lines
623 B
YAML
# HTTP (entrypoint web) -> HTTPS redirect voor ns.labzand.com.
|
|
# De Ingress zelf heeft een tls-sectie, waardoor Traefik die router alleen
|
|
# op websecure matcht; daarom hier een aparte router op web.
|
|
# services: api@internal is een dummy - de redirect middleware stuurt
|
|
# nooit door naar een backend.
|
|
apiVersion: traefik.io/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: ns-redirect
|
|
namespace: external
|
|
spec:
|
|
entryPoints:
|
|
- web
|
|
routes:
|
|
- match: Host(`ns.labzand.com`)
|
|
kind: Rule
|
|
middlewares:
|
|
- name: redirect-https
|
|
services:
|
|
- name: api@internal
|
|
kind: TraefikService
|