real_ip_header X-Forwarded-For;
real_ip_recursive on;
proxy_set_header X-Real-IP $realip_remote_addr;
proxy_set_header X-Remote-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
When I print it in my webapp, I still get the cluster ip.
2016-08-06T18:21:44.673040983Z Accept-Language: en-US,en;q=0.8,ms;q=0.6
2016-08-06T18:21:44.673043845Z X-Real-Ip: 10.112.0.1
2016-08-06T18:21:44.673046728Z User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
2016-08-06T18:21:44.673055659Z X-Requested-With: XMLHttpRequest
2016-08-06T18:21:44.673058414Z X-Nginx-Proxy: true
2016-08-06T18:21:44.673064279Z X-Forwarded-Proto: https
2016-08-06T18:21:44.673069963Z Accept: */*
2016-08-06T18:21:44.673075479Z X-Forwarded-For: 10.112.0.1
2016-08-06T18:21:44.673078246Z X-Remote-Ip: 10.112.0.1
2016-08-06T18:21:44.673080983Z Accept-Encoding: gzip, deflate, sdch, br