Hello,
As you know, when you use CloudFlare on your websites, CloudFlare hides the real IP records. If you are using CloudFlare in DNS only mode, you do not need to take action. However, if you are using in Proxied mode, CloudFlare will hide the real ip records.
If you are using hosting service, you need to request this process to be done by the company you receive hosting service. However, if you are using your own VDS/VPS service, you need to log in to the control panel (e.g. Plesk, cPanel, CyberPanel) installed on your server.
Let's say you are using Plesk panel. All you need to do is; Plesk Panel >> Subscription >> domain.com >> Apache & nginx Settings >> Additional nginx directives
Following the steps above, you need to add the following codes.
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
Display More
The process is that simple, now you will be able to log the real ip addresses of all users logging into your website. In today's topic, we have provided information via plesk panel, but you can make additions to Apache directives or Litespeed directives for cPanel in the same logic. At least if you can't, you can request help by specifying in the comments.