My visits all have cloudflare ips

Hello,

Why do my website visitors getting cloudflare ips? Is there a way to make it show the real IP of the users?

Thanks

Yes. Cloudflare sends the visitor’s real IP in the header Cf-Connecting-Ip, which you can use in logs and to pass to your backed in place of the REMOTE_ADDR.

https://support.cloudflare.com/hc/en-us/sections/200805497-Restoring-Visitor-IPs

Hi,

Can you tell me how can i do that? I have .html, can i insert any code there?

Thanks

HOW can i do it?

Hi @tubesony,

The link posted by @Judge explains how to get this set up.

I read that many days ago and it did not help that is why I came here:
This code is in the top before <body> but still no go:

<?php if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];?>
<script type = "text / javascript">

i tried the TomCat code but it did not work.