I encounter a problem to show the real user IP address. I use the following code :
$_SERVER["HTTP_CF_CONNECTING_IP"]
For some users (only few of them) the IP returned is not the correct one. I made a check with others website who provide ip informations (ipify, my-ip…)
This is the result for one of my customer who have the problem. There is a difference.
The result for “Serveur prive” my website, is different.
AS | IP | AS Name
15557 | 79.86.104.250 | LDCOMNET, FR
AS | IP | AS Name
47887 | 82.212.74.252 | NEU-AS, JO
The user could have been on their mobile, connected to a different network at the time or using a VPN. Cloudflare reports the IP address connected to it in that field, you can compare it against the x-forwarded for field for the same requests to be certain.