Open gerrieg opened 4 months ago
@gerrieg Could you please elaborate on your use case to help us understand this request?
We need to support multiple ports on the same hostname and forward to different services per port
Here is an example:
There is also a strange thing, that the x-forwarded-port has the envoy port 10443 if the request comes via 443.
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: default-gateway
namespace: envoy-gateway-system
spec:
gatewayClassName: default-gateway
listeners:
- name: https
protocol: HTTPS
port: 443
allowedRoutes:
namespaces:
from: All
hostname: "*.xxxxx.xxxxxx.xxx"
tls:
certificateRefs:
- kind: Secret
group: ""
name: default-gateway-cert
- name: https2
protocol: HTTPS
port: 8454
allowedRoutes:
namespaces:
from: All
hostname: "*.xxxxx.xxxxxx.xxx"
tls:
certificateRefs:
- kind: Secret
group: ""
name: default-gateway-cert
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
namespace: eai
spec:
hostnames:
- xxx.xxxxx.xxxxxx.xxx
parentRefs:
- name: default-gateway
namespace: envoy-gateway-system
rules:
- backendRefs:
- name: backend-ref-1
port: 8454
weight: 1
matches:
- headers:
- name: x-forwarded-port
value: "8454"
- backendRefs:
- name: backend-ref-2
port: 8080
weight: 1
matches:
- headers:
- name: x-forwarded-port
value: "10443"
This issue has been automatically marked as stale because it has not had activity in the last 30 days.
@gerrieg you can split up your HTTPRoutes into 2 (its fine to have the same hostname
in both ) and link each one to a different listener using parentRef
similar to the HTTP Redirect example https://gateway.envoyproxy.io/latest/tasks/traffic/http-redirect/#http----https
This issue has been automatically marked as stale because it has not had activity in the last 30 days.
append_x_forwarded_port