Cloudflare Causing 403 Error only when active

Hello,
I’ve added my website to Cloudflare CDN and it won’t work, as its returning a 403 error. Im new to all of this so I’ve contacted my hosting provider support but they couldn’t figure it out and now I’m left with no solution, I’ve tried some of the tutorials to try to fix it but it didn’t work. They even checked my DNS management and told me that everything was right there and that they don’t know what might cause this error. My website work fine when I disable Cloudflare though, can someone help me to resolve this issue?

2 Likes

Hello there,

May I suggest you to check this #tutorial & follow the steps?

Alternatively, Would you share the site here example dot com

The 403 is coming from your Origin Apache server. Do you have any access control logic in your Apache config, such as Require, RemoteIPTrustedProxy etc.?

No to my knowledge I don’t have access to those, I’m using the Hpanel on Hostinger, can you give a tutorial on how to check that?

@alexandre222 have you set any restrictions in htaccess file?

No I didn’t set any rules, also the support team try to use a new htaccess but it didn’t work. My website works fine when the A record is not proxied by Cloudflare though. My website currently showed a black and white Error 403 Forbidden page right now. What do you think I can do to diagnose the issue?

@alexandre222
The solution what I tell you has worked well for me in the same scenario.

You can give it a try:

In the Hostinger, set the NS records to default. Refresh, check your domain for the error (the error should disappear), upon this process, now you update the CF NS records. That should work for you.

I’ve bought my domain on Bluehost and my hosting provider is Hostinger. I’ve tried plenty of time pointing my nameservers to Hostinger and it would works then after I change it back to Cloudflare, this 403 Error would appears. I’ve done this like 3 times. So do you think it might be a permissions problem?

@alexandre222

In the case of hostinger or other (I’m not certain though), whenever certain changes are made in file permission or folder or http / https, this error occurs. To avoid such scenario, pause the CF and do changes. That works well.

Should I change the permissions via Filezilla or the Hostinger file manager?

@alexandre222

That’s preferably up to you. However, pause CF whenever you make changes.

Just to let you know, I’m using FileZilla to change the permissions and its still not done, I’m gonna let you know if it’s working now when its done, thank you.

Hi, alex,

CDN needs cdn providers records. What happen with cloudflar that, when you add CDN records in DNS
by default Proxied is On. You can try with Off. DNS Only option on your CNAME
Screenshot 2022-10-05 143436|184x102

Thanks
Webber
https://usps-track.us

hello @mr.viable ,
Wouldn’t it expose my website DNS if its not proxied by Cloudflare thus reducing the protection and global speed of my website?

I think exposing cdn provider is not risking your site real dns records. So , dont worry about the exposing dns provider …

@neiljay Even after I’ve check the permissions, It’s still showing a 403 error, do have any other ideas what might be the issue?

@mr.viable Tried this too and It’s still showing the 403 error, do you also have any ideas what other fix might work on that? ( the problem seems to be in my A record )

May I ask on which page or URL you get 403?
Is it the simple index.html?
Have you tried temporary removing or modifying your .htaccess file?
Are you using WordPress maybe?

If you temporary enable the “Pause Cloudflare for this site” option from the CF dashboard bottom-right corner, does it work then or still shows the same warning/error?
Does your Website work fine over HTTPS when Paused?

You could determine if the 403 is caused by Cloudfalre by using “Pause” option as follows:

  1. Use the “Pause Cloudflare on Site” option from the Overview tab for your domain at dash.cloudflare.com .
  2. The link is in the lower right corner of that page.
  3. Give it five minutes to take effect, then make sure site is working as expected with HTTPS.

Furthermore, I wonder if any of Cloudflare security & protection settings like Bot Fight Mode or Browser Integrity Check challenged or blocked the request :thinking:

have you created cdn subdomain ? is it work like cdn.yoursite. com ?

@fritex

  • yes I get the 403 on the index page/home page and if I try to type the exact page URL I want to access, I get a 404 error.
    -Yes I’ve tried to remove or even modify the .htaccess file and its still didn’t work.
    -Yes I’m using Wordpress

-Yes my website works fine when Cloudflare is pause
-[quote=“fritex, post:20, topic:422990”]
Furthermore, I wonder if any of Cloudflare security & protection settings like Bot Fight Mode or Browser Integrity Check challenged or blocked the request
[/quote]
How to I check that please?

@mr.viable No I didn’t create a subdomain, its just my domain name and that its. Do you think it might be caused by the fact that my domain was bought at Bluehost and my hosting is Hostinger, because I had the same 403 error with another Hosting provider with this exact domain but the technicians were able to fix it there?

Sorry for the late response I had to wait 5 hours to be able to post again.