Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

How to Get Real User IP...

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
Kill3r
Posts: 6
Joined: Tue Aug 23, 2016 5:03 pm

How to Get Real User IP...
  • Quote

Post by Kill3r » Sat May 20, 2017 9:56 am

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...
Top

maxplay
Posts: 4
Joined: Mon Feb 13, 2017 12:06 am

Re: How to Get Real User IP...
  • Quote

Post by maxplay » Tue May 30, 2017 2:15 am

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...
Top

patstan
Posts: 117
Joined: Wed Jul 30, 2014 10:53 am

Re: How to Get Real User IP...
  • Quote

Post by patstan » Tue May 30, 2017 3:24 pm

Simply use

Code: Select all

<?php

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


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password