Nginx/iptables passing ipclient ip

Todd@VRG nginx-forum at
Fri Nov 29 22:44:41 UTC 2013


I have nginx reverse proxy setup on a ubuntu server to pass to webservers...


eth1 = external_ ip  
eth0 = internal_ ip

Webserver 1 ip XX1
webserver 2 ip XX2

nginx is forwarding traffic to webservers..

I tried both..
proxy_set_header X-Forwarded-For $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

I have iptables for my firewall with proper ports and IPs open..

the ip address I still see in the logs is the eth0 = internal_ ip
I can change the ip the webserver is seeing using POSTROUTING SNAT

This lead me to believe I have something miss configured that the Nginx can
not pass the real client IP to the webservers..


Posted at Nginx Forum:,245092,245092#msg-245092

More information about the nginx mailing list