How to Fix Error 403 Forbidden on Cloudflare

Seeing a Cloudflare 403 forbidden error pop up is really frustrating. It often happens because of some updates your hosting service did or maybe some settings got mixed up on your end.

We will examine the possible solutions to fix 403 forbidden errors on your site.

Cloudflare 403 Forbidden Error Nginx
Sigh, this is not what I wanted to see when I opened my 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.

If the error message doesn’t show Cloudflare’s usual look, the issue is likely with your own web server, not Cloudflare. This usually involves the access rules set up on your server.

Top Reasons Why You May See the HTTP Status Code On Your Screen

  1. Empty website directory
  2. Permission/ ownership error in the rules you have set
  3. 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

  1. Empty Website Directory
  2. No Index Page
  3. Permissions and Ownership

Understanding why you’re seeing this error is the first step. Next, let’s figure out how to fix it and get your site running smoothly again.

1. Empty Website Directory

First, check if your site contents have been uploaded to the correct directory.

  1. 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

  1. 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.
  2. The client DNS cache could be pointing to the origin server. Use a private browsing mode or switch your browser entirely.
  3. Try disabling Browser Integrity Check for the site.
  4. If the error only appears from certain countries, then check the origin server’s configuration for a country block.
  5. 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’)
  6. 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. 

Summary

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!

If you’re looking for (free) tips to optimize your site speed with Cloudflare and rank higher on Google, you can follow me on Twitter 👉🏻 @bitofseo.

Please DM me if you have any questions about this Cloudflare article (or have some feedback to make it better 😄️).

About Jake Sacino

After working as an engineer and consultant for a bunch of big companies, Jake now works as a full-time SEO & software engineer.