HTTP 403 Forbidden

0

I’ve added my site to Cloudflare. I’m trying to allow requests to only come in through Cloudflare’s network, and reject all others. When I add the following to my .htaccess, I get HTTP 403 Forbidden.

# Cloudflare Firewall Bypass Prevention
<RequireAll>
    Require all denied
    Require ip 103.21.244.0/22
    Require ip 103.22.200.0/22
    Require ip 103.31.4.0/22
    Require ip 104.16.0.0/13
    Require ip 104.24.0.0/14
    Require ip 108.162.192.0/18
    Require ip 131.0.72.0/22
    Require ip 141.101.64.0/18
    Require ip 162.158.0.0/15
    Require ip 172.64.0.0/13
    Require ip 173.245.48.0/20
    Require ip 188.114.96.0/20
    Require ip 190.93.240.0/20
    Require ip 197.234.240.0/22
    Require ip 198.41.128.0/17
    Require ip 2400:cb00::/32
    Require ip 2606:4700::/32
    Require ip 2803:f800::/32
    Require ip 2405:b500::/32
    Require ip 2405:8100::/32
    Require ip 2a06:98c0::/29
    Require ip 2c0f:f248::/32
</RequireAll>

The list of IPs comes directly from Cloudflare’s IP ranges. In theory, Cloudflare acts as a reverse proxy for my server. Why aren’t requests coming from Cloudflare? Any ideas on what I messed up, or how to fix it?

Unless you firewall your server, people can still access your server IP directly. I did find this .htaccess file with a quick google.

Not sure how up to date it is though.

did you even read the question

Yeah

Replied with

And the .htaccess I linked is different from yours, so maybe the format is messed up.

don’t work bud

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.