Skip to content

Instantly share code, notes, and snippets.

@speedupmate
Created August 4, 2021 12:06
Show Gist options
  • Save speedupmate/717849dbd5a4120d25d6f3ad0d6c0489 to your computer and use it in GitHub Desktop.
Save speedupmate/717849dbd5a4120d25d6f3ad0d6c0489 to your computer and use it in GitHub Desktop.
#get the ips from https://www.cloudflare.com/ips/
SetEnvIfExpr "-R '173.245.48.0/20' || -R '103.21.244.0/22' || -R '103.22.200.0/22' || -R '103.31.4.0/22' || -R '141.101.64.0/18' || -R '108.162.192.0/18' || -R '190.93.240.0/20' || -R '188.114.96.0/20' || -R '197.234.240.0/22' || -R '198.41.128.0/17' || -R '162.158.0.0/15' || -R '172.64.0.0/13' || -R '131.0.72.0/22' || -R '104.16.0.0/13' || -R '104.24.0.0/14'" cf_ipv4
SetEnvIfExpr "-R '2400:cb00::/32' || -R '2606:4700::/32' || -R '2803:f800::/32' || -R '2405:b500::/32' || -R '2405:8100::/32' || -R '2a06:98c0::/29' || -R '2c0f:f248::/32'" cf_ipv6
Order deny,allow
Deny from all
Allow from cf_ipv6
Allow from cf_ipv4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment