From e476bc9fc4a9e59926b6e6d6bced997b22940a11 Mon Sep 17 00:00:00 2001 From: Unchained Date: Thu, 2 Apr 2026 22:49:26 +0200 Subject: [PATCH] fix(k8s): add HTTP to HTTPS redirect for manoonoils.com - Create redirect-https middleware for permanent redirect (301) - Split IngressRoute: HTTP route redirects to HTTPS, HTTPS route serves app - Fixes Google Search Console 404 error on HTTP version - No application code changes, only routing configuration --- k8s/ingress.yaml | 30 +++++++++++++++++++++++------- k8s/kustomization.yaml | 1 + k8s/middleware.yaml | 9 +++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 k8s/middleware.yaml diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index be9b922..767fa5b 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -5,13 +5,29 @@ metadata: namespace: manoonoils spec: entryPoints: - - web - - websecure + - web routes: - - match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) - kind: Rule - services: - - name: storefront - port: 3000 + - kind: Rule + match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) + middlewares: + - name: redirect-https + services: + - name: storefront + port: 3000 +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: storefront-secure + namespace: manoonoils +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) + services: + - name: storefront + port: 3000 tls: certResolver: letsencrypt diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 1a44fe8..54dedf0 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -3,6 +3,7 @@ kind: Kustomization resources: - deployment.yaml - service.yaml + - middleware.yaml - ingress.yaml images: - name: ghcr.io/unchainedio/manoon-headless diff --git a/k8s/middleware.yaml b/k8s/middleware.yaml new file mode 100644 index 0000000..e71432c --- /dev/null +++ b/k8s/middleware.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-https + namespace: manoonoils +spec: + redirectScheme: + scheme: https + permanent: true