aks-app-routing-operator icon indicating copy to clipboard operation
aks-app-routing-operator copied to clipboard

feature request: allow configuration of use-forwarded-headers

Open oocx opened this issue 5 months ago • 1 comments

Currently, nginx always replaces the x-forwarded-host header with the host name specified in the ingress.

Setting the use-forwarded-headers: "true" annotation has no effect on this behavior. Setting use-forwarded-headers: "true" in the nginx ConfigMap works, but is not supported.

It would be great if there was an officially supported method to prevent nginx from replacing x-forwarded-* headers.

Use case: We have a multi tenant SaaS product. Each tenant has custom domains to access our product, for example customer1.idp.ourproductname.cloud. When this domain is accessed, the request is first processed by Azure API Management, and then forwarded to our AKS cluster with x-forwarded-host set to customer1.idp.ourproductname.cloud. When nginx then forwards the request to our application running in AKS, the x-forwarded-host is replaced so that our service cannot identifiy the tenant for this request any more.

Possible solutions:

  • allow setting use-forwarded-headers in ingress annotations
  • add use-forwarded-headers setting to NginxIngressController

oocx avatar Aug 20 '25 04:08 oocx

I added the Feature as an optional bool in PR #490

DomianFlomian avatar Aug 21 '25 09:08 DomianFlomian