On proxy my nginx show wrong ip (private)

dong nginx-forum at nginx.us
Tue Nov 23 21:45:02 MSK 2010

Hello, Im using FreeBSD and jail. I have main nginx server in jail (ip Second www server is apache22 (

Port 80 from is forwarding to public IP. 

Problem is in this that php scripts from apache ( showing
client IP from nginx ( For example: phpBB showing on line
users and ips

Its my settings in nginx (
--- START---
server {
        listen 80;
        server_name www.skuter-forum.pl skuter-forum.pl;
        access_log  /var/log/nginx/skuter-forum.pl.access.log;

        if ($host = 'www.skuter-forum.pl' ) {
                                    rewrite ^/(.*)
http://skuter-forum.pl/$1 permanent;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;

 --- END ---

How set real clients ips?

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

More information about the nginx mailing list