If you are running a load balancer that is used to offload the TLS, in front of Nginx Ingress Controller, or if you are setting X-Forwarded-*
headers, you might want to enable the use-forwarded-headers=true
option. Otherwise, Nginx will fill those headers with the request information it receives from the external load balancer.
Run the following commands to enable the option.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update kubectl create namespace ingress-nginx helm upgrade --install ingress-nginx --namespace ingress-nginx ingress-nginx/ingress-nginx --set-string controller.config.use-forwarded-headers=true
Alternatively, create a values.yaml
file with the following content. then install nginx-ingress
with the values file you created.
controller: config: use-forwarded-headers: "true"
Run the following commands after you create the values.yaml file.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update kubectl create namespace ingress-nginx helm upgrade --install ingress-nginx --namespace ingress-nginx ingress-nginx/ingress-nginx -f values.yaml