apache-ultimate-bad-bot-blocker icon indicating copy to clipboard operation
apache-ultimate-bad-bot-blocker copied to clipboard

Not working with cloudflare

Open manuelfr51 opened this issue 6 years ago • 9 comments
trafficstars

Not working on cloudflare protected domains, even with mod_remoteip

manuelfr51 avatar Mar 15 '19 13:03 manuelfr51

Seen this before and unfortunately unable to test or find a solution as I simply don't use cloudflare for anything. The blocker itself is more than capable of doing the work I and hundreds of users require it to do without putting cloudflare into the equation.

mitchellkrogza avatar Mar 16 '19 06:03 mitchellkrogza

only real solution was to implement htaccess rules when using cloudflare, hope some one find another way server wide

manuelfr51 avatar Mar 17 '19 01:03 manuelfr51

Glad u found a partial solution ... There are some nginx setting to capture / forward real ips. I'll post those for you to try.

mitchellkrogza avatar Mar 17 '19 06:03 mitchellkrogza

Hi, I'd like to second this concern. I would like to help solve this issue for my Cloudflare -> Plesk Nginx -> Apache stack. It should be possible by using the X-FORWARDED-FOR header or similar, assuming we can get it through the proxy chain. I am going to start looking into a fix but any sample nginx configs would be a big help.

elverado avatar May 03 '19 12:05 elverado

I'm starting here as a refresher on how cloudflare and Nginx can keep the true origin IP passed through https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx-

elverado avatar May 03 '19 12:05 elverado

For the IP Passthrough I found out that the free version of the ServerShield Cloudflare Plesk extension activates and configures their mod_cloudflare module; looking promising. These links should help others: https://www.cloudflare.com/technical-resources/ and https://talk.plesk.com/threads/how-to-install-mod_cloudflare-without-extension.342938/

elverado avatar May 03 '19 12:05 elverado

Also the bottom of this thread showing both Apache and NGINX pieces https://talk.plesk.com/threads/nginx-ngx_http_realip_module-for-plesk.334492/

elverado avatar May 03 '19 12:05 elverado

Hello,

I am using wordpress with cloudflare. I use a plugin for site settings.

add_filter('robots_txt', 'clc_robots_file'); function clc_robots_file( $robotext ) { include CLC_SITE_SETTINGS_PATH . 'inc/robots.php'; return $robotext . $robot_file_additions; }

the robots.php contains the file as a string. It has been working for me if anyone finds it useful.

jmastrom123 avatar Aug 21 '19 14:08 jmastrom123

Just wanted to mention that it works fine for me with Apache and mod_cloudflare (as per the support doc previously linked by @elverado) 👍

EDIT: I just found out that mod_cloudflare is not supported anymore (even though it works on Ubuntu 20.04), but in turn mod_remoteip is supported. I can confirm that it works for me too.

ayoy avatar Nov 19 '20 19:11 ayoy