feature request: allow configuration of use-forwarded-headers
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
I added the Feature as an optional bool in PR #490