The Cloudflare 403 forbidden error is super annoying. It may result from changes or updates that your hosting company made in their system or configuration errors at your end.
We will examine the possible solutions to fix 403 forbidden errors on your site.
What is Error 403 Forbidden Cloudflare-Nginx?
403 Cloudflare is an error that occurs when a client sends a request the origin is unable to authorize or process. The forbidden-error is an HTTP status code showing denied permissions.
Let’s examine the causes of Cloudflare errors and how to fix them on your site.
Causes of 403 Forbidden Cloudflare Error?
Cloudflare will typically only serve 4xx responses or Cloudflare access denied for the following reasons:
- If your request violates a Web Application Firewall (WAF) rule enabled for all Cloudflare domains.
- If the request violates the WAF rule enabled for the particular zone you tried to reach.
- SSL connections to domains /subdomains with no correct SSL certificates.
You may contact Cloudflare support if you have questions and include a screenshot of the message you received. The Cloudflare community is also a good platform to find help for 4xx and other related errors.
If the message you are seeing is without Cloudflare branding, it is a client-side error from your web server and not Cloudflare. It has to do with permission rules on your server.
Top Reasons Why You May See the HTTP Status Code On Your Screen
- Empty website directory
- Permission/ ownership error in the rules you have set
- No index page
If the above is the case, you should contact your hosting provider to resolve the issue since Cloudflare can’t directly access your server. However, ensure that your Cloudflare’s IPs are working correctly.
How To Fix Error 403 Forbidden Cloudflare
- Empty Website Directory
- No Index Page
- Permissions and Ownership
Now that you know the different reasons why your web server returns the HTTP status code error, it is time to see how to fix it.
1. Empty Website Directory
First, check if your site contents have been uploaded to the correct directory.
- Plesk server: /var/www/vhosts/website.com/httpdocs/
- Navigate to the httpdocs directory once you connect with your FTP user.
- Also, replace website.com with your real domain name.
2. cPanel server:/home/website/public_html/
- Navigate to the public_html directory once you connect with your FTP
- Ensure you replace the website with your cPanel account username.
Note: Ensure you create this folder if it does not exist on your site
2. No Index Page
Your website’s home page must be named index.php or index.html, and note that file names are case sensitive. You may upload an index page to your public_html or httpdocs directory to fix the problem.
In case you already have a home page named something else, say log.html, below are options to try.
- Rename your home page from log.html or whatever you call it, to index.php or index.html.
- Redirect from the index page to your actual home page you want
- Set a different default page in the .htaccess file
3. Permissions and Ownership
You may also experience this issue due to incorrect permissions or ownership in your web files or folders.
Here’s the correct permission configuration:
- Folders: 755
- Static Content: 644
- Dynamic Content: 700
Other Ways to Fix The 403 Forbidden Cloudflare Error
- The issue may be a temporary message due to the upgrade from free to a pro subscription. It is possible to receive the error 403 Cloudflare while replacing the free account certificate with the pro account on your site.
- The client DNS cache could be pointing to the origin server. Use a private browsing mode or switch your browser entirely.
- Try disabling Browser Integrity Check for the site.
- If the error only appears from certain countries, then check the origin server’s configuration for a country block.
- Suspend Cloudflare temporarily until you can fix the root cause of the problem. (To pause Cloudflare, navigate to your Cloudflare dashboard and select ‘Pause Cloudflare’ in the ‘Advanced Menu’)
- Visit the Cloudflare community for tips on how to fix 4xx errors; you may also reach out to the Cloudflare community for help from experts.
Consider the above steps only if you’ve tried the regular solutions and still unable to fix the Cloudflare 403 forbidden error.
4xx Cloudflare is a message you may receive due to various reasons, and it can sometimes be frustrating for users. We have provided the causes and steps to fix the issue.
We are sure you will be able to restore your site to a working state by following the steps outlined above. Remember that your hosting provider and Cloudflare support are ready to help you out!