Page 1 of 1

How to Get Real User IP...

Posted: Sat May 20, 2017 9:56 am
by Kill3r
Hello Team,

I have some problem with logs.... then i found this:https://support.cloudflare.com/hc/en-us ... ith-Nginx-

Can anyone guide me on how to fix this problem...

Re: How to Get Real User IP...

Posted: Tue May 30, 2017 2:15 am
by maxplay
Hi, are you using nginx + apache? in that case you can set headers in nginx so apache receives them and sets the client IP accordingly.

could you look into your phpinfo? (make a file info.php that contains this code:

Code: Select all

<?php phpinfo(); ?>
then lookit online http://www.yourdomain.com/info.php

and search for REMOTE_ADDR

then post some more info here...

Re: How to Get Real User IP...

Posted: Tue May 30, 2017 3:24 pm
by patstan
Simply use

Code: Select all

<?php

 $ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
 
?>