-
Notifications
You must be signed in to change notification settings - Fork 140
Description
When routing to an ExternalName service alongside internal services in the same HTTPRoute, NGF incorrectly sets the Host header to the Gateway's hostname instead of the external service's hostname, causing requests to fail. Example Configuration:
apiVersion: v1
kind: Service
metadata:
name: httpbin
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: mixed-route
spec:
parentRefs:
- name: gateway
hostnames:
- cafe.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /external
backendRefs:
- name: httpbin # ExternalName service
port: 443
- matches:
- path:
type: PathPrefix
value: /internal
backendRefs:
- name: coffee # ClusterIP service
port: 80Expected Behavior: Requests to /external should have Host: httpbin.org header set when proxying to the external service.
Actual Behavior: Requests to /external have Host: cafe.example.com header set, causing the external service to reject the request (typically with 503 or host mismatch errors).
Impact:
ExternalName services cannot be used for routing to external APIs/services that require correct Host headers
No workaround available (we don't allow Host header modification via RequestHeaderModifier)
Properly set Host header based on ExternalName service hostname.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status