Jump to content

get clients original ips to show in client area while using cloudflare


Recommended Posts

i have tried so many different things from google and i cant seem to figure this out. i can see the clients real ip in the admin area but when they login and place an order it shows the proxy ip. so if i try to ban a client it will not work because they are logging in with the proxy ip

i have added the trusted ips from couldflare and used the headers: CF-Connecting-IP  and  X_FORWARDED_FOR 

i have even created a hook: 

<?php if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) 
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
?>

none of this seems to work. can someone please give me the breakdown on the steps to fix this issue please.


Screenshot_130.png

Screenshot_131.png

Link to comment
Share on other sites

On 7/26/2024 at 6:13 PM, Alien Hosting said:

someone please help

 

If you executed it correctly, what is in the link ( https://docs.whmcs.com/system/trusted-proxies/ ) should work.

Take a testa, edit the configuration.php file and insert it on the last line:

if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) {if (filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP)) {$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];}}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated