Enabling x-forwarded-* headers #4097
-
In our first steps with Envoy Gateway we have installed it with Helm on Kubernetes in AWS, we have set up a few HTTPRoutes successfully over HTTPS and we are now trying to get it to talk to Keycloak for authentication. As the original target microservice configured in HTTPRoute redirects the client to Keycloak for authentication, Keycloak expects to see the following headers:
In https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#x-forwarded-for I can see how such functionality can be configured in Envoy. And it looks quite challenging. Still, we're not using Envoy exactly, we are using Envoy Gateway, so what is the recommended way to enable such headers? Is this done with a BackendTrafficPolicy, perhaps? Or with extra settings in the Please note that we have enabled the proxy protocol with a ClientTrafficPolicy. Details in #4064 (thanks to Lior) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
We are using Keycloak like this..and it works as expected ( https )NLB ---> (http) Envoy ---> Keycloak apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: keycloak
namespace: keycloak
spec:
parentRefs:
- name: eg-external
namespace: envoy-gateway-system
kind: Gateway
hostnames:
- "auth.example.com"
rules:
- backendRefs:
- group: ""
kind: Service
name: keycloak-service
namespace: keycloak
port: 8080
weight: 1
matches:
- path:
type: PathPrefix
value: /
filters:
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: X-Forwarded-Proto
value: "https" |
Beta Was this translation helpful? Give feedback.
-
there's also a dedicated setting in ClientTrafficPolicy for setting |
Beta Was this translation helpful? Give feedback.
We are using Keycloak like this..and it works as expected
( https )NLB ---> (http) Envoy ---> Keycloak