Restoring original visitor IPs: Logging visitor IP addresses with mod_cloudflare

Learn how to configure mod_cloudflare to log your visitor’s original IP address based on your origin web server type (including Apache, nginx, Microsoft IIS and others).

Cloudflare no longer updates and supports mod_cloudflare, starting with versions Debian 9 and Ubuntu 18.04 LTS of the Linux operating system. Customers who are interested in building the mod_cloudflare package can download the codebase from GitHub.

Overview

Cloudflare includes the original visitor IP address in the X-Forwarded-For and CF-Connecting-IP headers.

  • These headers can restore the originating IP of your visitors or include them in your logs.
  • However, the configuration process depends on what web server you’re using.

See Restoring Original Visitor IPs: Option 1 for more information on installing mod_cloudflare.


Restoring visitor IPs by web server type

See below for instructions on how to configure mod_cloudflare to log original visitor IPs based on your web server type:


Related Resources

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk