How can I find IP Geolocation values?

I review this blog

and enabled the IP Geolocation feature bue I cannot find the IP visitor on my apache log neither on dashboard. There is no log or place to look for this value

Could you help me where I can find them in backend debian server or on cloudflare dashboard?
#ipGeolocation

As the article you linked to shows, it has nothing to do with IP addresses in your log. It’s an HTTP Response Header.

If you want Visitor IP addresses in your logs, here are some resources:
https://support.cloudflare.com/hc/en-us/sections/200805497-Restoring-Visitor-IPs

1 Like

Its not clear if you are looking for the users IP address, or the users Geolocation (country code).

Both are presented as HTTP request headers to your origin server.

You can get the visitor IP using the proposed solution from @sdayman

The country code is in the CF-IPCountry header, so can be added to Apache logs using syntax like this:
LogFormat "%h %l %u %t \"%r\" %>s %b %{CF_IPCOUNTRY}i " combined

You mentioned to add to apache log. Does the apache just to write log not to apply commands?

Or you meant I can retreive IP address for the visitors with this command:

LogFormat "%h %l %u %t \"%r\" %>s %b %{CF_IPCOUNTRY}i " combined

``

??

``

I just need to see the IP visitors

Regards.

Abdulghani Alkhateeb

If you just want the visitors IP address, then you do not need IP Geolocation.

LogFormat is an Apache configuration, you probably have a LogFormat line in your config already. You can modify that line in your config to include %{CF_IPCOUNTRY}i. (This will only work from after you change the config and reload Apache, so no going back in time)

You could also use the mod_remoteip module. use RemoteIPHeader CF-Connecting-IP in your config to get the visitor IP in your normal logs.

2 Likes

This topic was automatically closed after 14 days. New replies are no longer allowed.