fix(k8s): add HTTP to HTTPS redirect for manoonoils.com
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
- 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
This commit is contained in:
@@ -5,13 +5,29 @@ metadata:
|
|||||||
namespace: manoonoils
|
namespace: manoonoils
|
||||||
spec:
|
spec:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- web
|
- web
|
||||||
- websecure
|
|
||||||
routes:
|
routes:
|
||||||
- match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`)
|
- kind: Rule
|
||||||
kind: Rule
|
match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`)
|
||||||
services:
|
middlewares:
|
||||||
- name: storefront
|
- name: redirect-https
|
||||||
port: 3000
|
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:
|
tls:
|
||||||
certResolver: letsencrypt
|
certResolver: letsencrypt
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
- middleware.yaml
|
||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
images:
|
images:
|
||||||
- name: ghcr.io/unchainedio/manoon-headless
|
- name: ghcr.io/unchainedio/manoon-headless
|
||||||
|
|||||||
9
k8s/middleware.yaml
Normal file
9
k8s/middleware.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: redirect-https
|
||||||
|
namespace: manoonoils
|
||||||
|
spec:
|
||||||
|
redirectScheme:
|
||||||
|
scheme: https
|
||||||
|
permanent: true
|
||||||
Reference in New Issue
Block a user