Hello,
Is it possible to change where Apache sources IPs for the access.log file? Right now I am getting Cloudflare’s IP. Is it possible that I could change this to be the real IP of the user with PHP or in an Apache Configuration file?
Hello,
Is it possible to change where Apache sources IPs for the access.log file? Right now I am getting Cloudflare’s IP. Is it possible that I could change this to be the real IP of the user with PHP or in an Apache Configuration file?
Cloudflare have answered that in their documentation:
Note though that the last block under Apache 2.4 seems to be missing some brackets. It should be
<IfModule cloudflare_module>
CloudFlareRemoteIPHeader X-Forwarded-For
CloudFlareRemoteIPTrustedProxy [insert your load balancer’s IP address]
DenyAllButCloudFlare
</IfModule>
Also, once you found that it works you can remove the <IfModule cloudflare_module>
and </IfModule>
lines and just keep what’s in between. There is no need to check for the module over and over when you know it’s there.
Thanks for the response. This looks like it will work, but Cloudflare’s IP will often change depending on the visitors location.
I tried that first as I run Debain 10, still didn’t work so I’m asking the cloudflare community.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.