all visitor have same IP (my server IP)

Payam Chychi pchychi at gmail.com
Tue Dec 16 17:53:59 UTC 2014


On 2014-12-16, 9:32 AM, umarizal wrote:
> Anoop Alias Wrote:
> -------------------------------------------------------
>> Are you seeing the same IP in apache?.
>>
>> If yes then you need the following module in apache
>> https://github.com/gnif/mod_rpaf or
>> http://httpd.apache.org/docs/trunk/mod/mod_remoteip.html
>>
>> -- 
>> *Anoop P Alias*
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
> Sorry, but I don´t understand your question. How do I see it?
>
> Thank you very much! :D
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225160,255538#msg-255538
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
There are multiple areas/ways of getting the non-proxied ip address.  
One of Anoop recommendation was that you utilize the remoteip method.
This isn't a but, its simply the fact that you are proxying the 
connection so the connections will in fact look to come from the address 
of your nginx server.

What the remoteip (realip) allows nginx to capture the src-Ip address of 
the connection and then pass it to apache, then you configure apache to 
look for say "remote_addr" and utilize the value for whatever you are doing.

this isn't perfect but it works for my testing, allows me to see how the 
data is being passed.

<?php

echo "Remote addr: " . $_SERVER['REMOTE_ADDR']."<br/>";

echo "X Forward: " . $_SERVER['HTTP_X_FORWARDED_FOR']."<br/>";

echo "X Forward single: " . $_SERVER['HTTP_X_FORWARDED']."<br/>";

echo "HTTP_X_CLUSTER_CLIENT_IP: " . 
$_SERVER['HTTP_X_CLUSTER_CLIENT_IP']."<br/>";

echo "HTTP_FORWARDED_FOR " . $_SERVER['HTTP_FORWARDED_FOR']."<br/>";

echo "HTTP_FORWARDED " . $_SERVER['HTTP_FORWARDED']."<br/>";

echo "Clien IP: " . $_SERVER['HTTP_CLIENT_IP']."<br/>";

?>

hope this helps




More information about the nginx mailing list