1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 06:15:42 +00:00

Redirect HTTP to HTTPS (#2679)

This opens up port 80 on the load balancer IP and upgrades all HTTP
request to HTTPS.

TESTED=tested on alpha.
This commit is contained in:
Lai Jiang
2025-02-18 11:57:18 -05:00
committed by GitHub
parent eb978ebbd5
commit 6f7ae1eabc
5 changed files with 26 additions and 0 deletions

View File

@@ -5,6 +5,12 @@ metadata:
spec:
gatewayClassName: gke-l7-global-external-managed-mc
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
kinds:
- kind: HTTPRoute
- name: https
protocol: HTTPS
port: 443
@@ -15,3 +21,19 @@ spec:
allowedRoutes:
kinds:
- kind: HTTPRoute
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: redirect
spec:
parentRefs:
- kind: Gateway
name: nomulus
sectionName: http
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https

View File

@@ -6,6 +6,7 @@ spec:
parentRefs:
- kind: Gateway
name: nomulus
sectionName: https
hostnames:
- "backend.BASE_DOMAIN"
rules:

View File

@@ -6,6 +6,7 @@ spec:
parentRefs:
- kind: Gateway
name: nomulus
sectionName: https
hostnames:
- "console.BASE_DOMAIN"
rules:

View File

@@ -6,6 +6,7 @@ spec:
parentRefs:
- kind: Gateway
name: nomulus
sectionName: https
hostnames:
- "frontend.BASE_DOMAIN"
rules:

View File

@@ -6,6 +6,7 @@ spec:
parentRefs:
- kind: Gateway
name: nomulus
sectionName: https
hostnames:
- "pubapi.BASE_DOMAIN"
rules: