Restrict by IP in Apache behind Cloudflare

Penetration Testing Wiki

Restrict by IP in Apache behind Cloudflare

If you are using Cloudflare as first line of defense, and want to restrict by IP in the Apache webserver behind. Add this to your .htaccess:



SetEnvIF X-Forwarded-For "1.1.1.1" AllowIP
 
<RequireAny>
Require env AllowIP
</RequireAny>

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.