Real IP not working?

pk899 nginx-forum at nginx.us
Sun Dec 4 15:12:26 UTC 2011


Hi. Nginx 1.0.8 proxying to Apache 2. My version of PHP is 5.3.8, but
that's irrelevant I suppose. 

Nginx is with Real IP module. I have the following in my conf file: 


[code]
set_real_ip_from   192.168.1.0/24;
set_real_ip_from   192.168.2.1;
set_real_ip_from   127.0.0.1;
set_real_ip_from   [..my server ip..];
real_ip_header     X-Real-IP;
[/code]


Apache is also with module RPAF. And there's this bit in httpd.conf: 


[code]
LoadModule rpaf_module /usr/lib64/httpd/modules/mod_rpaf-2.0.so
<IfModule mod_rpaf.c>
RPAFenable On
RPAFproxy_ips  0.0.0.0  127.0.0.1  [...my server IPs...]
RPAFsethostname On
RPAFheader X-Real-IP
</IfModule>
[/code]


Yet, in Apache log, the client IPs are not shown. All the IPs in the log
are my own server's IP! 

How can I make sure that Apache shows the end user's IP?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,219581,219581#msg-219581



More information about the nginx mailing list