Cloudflare by default caches certain file extensions (like css, js, jpg etc). If the response is a 404 or 403 the response will be cached for 3m and 1m respectively, if there is no other cache-control header.
A 403 Forbidden Error is a client side error that means that the client sent something the origin was unable to process.
Cloudflare 403 forbidden error can occur due to many reasons. It includes Ip block, faulty rules set in .htaccess file, cache, and so on.
In this context, we shall look into ways to resolve this server error.
Methods to fix Cloudflare 403 forbidden error ?
Since this is a Server side error, it must be fixed from the server end.
Apply the tips below to resolve this error.
1. Start by checking if there are any IP blocks set in the account.
To do this, execute the command shown below to check for any IP block:
iptables -L INPUT -v -n
2. Next, we check the .htaccess file to see if there are any faulty rules set in the file. In case, if there are any such rules then we remove those rules and test the website if it works.
3. We try clearing the browser cache. A browser cache can also cause this error because the DNS cache might be pointing to the old server in case if there are any recent changes made in the DNS,
Or else, we simply access the website using some other browser and check if it works. If it works well without any error then it confirms the issue to be with the browser cache.
4. Also, we suggest customers enable the SSL on the domain. If there are no SSL certificates uploaded in Cloudflare for any subdomain then Cloudflare will display this error message.
So, it is important to have an SSL set for the domains if we are accessing the website with a secure connection.