We have an environment with k8s + Rancher 2 (3 nodes) and an external nginx that only forwards connections to the k8s cluster according to this documentation: [https://rancher.com/docs/rancher/v2.x/en/installation/k8s-install/]
Load Balancer Tutorial:
The problem is that in the logs of the applications that we host on the rancher, all the source requests only come with the ip address of nginx (load balancer) would need it to come with the real ip address of the person who made the request. Has anyone been through this situation and can help me?
I managed to resolve the situation. On the nginx load balancer I enabled proxy_protocol on both port 80 and port 443.
In rancher I edited the ingress-controller:
kubectl -n ingress-nginx edit cm nginx-configuration
I added the parameter below:
The file will look like this: