Cloudflare issue: Does CSF run before Apache?
Posted: 15 Dec 2023, 01:48
I'm using Cloudflare, and dealing with attacks that LOOK like they're coming from Amazon / Cloudflare IPs. At 3:06pm today my server load went from 0.68 to 150 inside of 1 second :-O
When Cloudflare sends the IP, it shows up as X-Forwarded-For. I use Apache's mod_remoteip to change that to REMOTE_ADDR in Apache config, using:
RemoteIPHeader X-Forwarded-For
But I'm not whether CSF would see the real IP of the user. Does CSF run before Apache (in which case REMOTE_ADDR wouldn't have been modified), or after? If it runs after Apache, how do I get CSF to use X-Forwarded-For?
When Cloudflare sends the IP, it shows up as X-Forwarded-For. I use Apache's mod_remoteip to change that to REMOTE_ADDR in Apache config, using:
RemoteIPHeader X-Forwarded-For
But I'm not whether CSF would see the real IP of the user. Does CSF run before Apache (in which case REMOTE_ADDR wouldn't have been modified), or after? If it runs after Apache, how do I get CSF to use X-Forwarded-For?