CloudFlare and logging visitor IP addresses

Following

[https://www.reddit.com/r/CloudFlare/comments/qgg8iw/cloudflare_and_logging_visitor_ip_addresses_via/]

I now use

$_SERVER[“HTTP_CF_CONNECTING_IP”]

in php to check the visitor ip address.

But then, a log file *.net.httpd.log only shows the cloudflrare ip addresses.

can one make the log file to display the visitor ip not the cloudflare ip?

The log file is controlled by the web server itself (NGINX/Apache/Litespeed). That software needs to be configured accordingly:

https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs

1 Like

This is what I am told. Can rpaf_module" help in getting the visitor’s real IP?

I have reviewed your inquiry and I would like to inform you that the “mod_remoteip” module is not installed by default on our server.

On our server with have a similar module to the “mod_remoteip” called “rpaf_module”, however, I am not aware if that would help you on your goal.

Additionally, bear in mind that we will not be able to install the "the “mod_remoteip” module as your account reside on a shared hosting environment and such a change would affect all the clients residing on the same server as you.

I found this article:

https://2bits.com/articles/correct-client-ip-address-reverse-proxy-or-content-delivery-network-cdn.html

Looks like it can be done.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.