Apache virtual host can't resolve through cloudflare proxy

I put an A record pointing to my server’s IP, and with the cloudflare proxy turned off it loads but once I turn it on apache wont load the page

Check server firewall

Thats not the problem, its open and it can be accessed when you directly visit the IP or turn off the cloudflare proxy

What error are you seeing? And what’s the domain?

it says 521 web server not responding

This prompt is that CDN cannot request your server normally

Correct, but leaving him or her alone with this fact isn’t helpful.

@1andonlypika

Please check out this Community Tip. Most of 521 errors have been solved by following the steps.

A 521 error happens when Cloudflare is unable to make a TCP connection to your origin server. Review the suggestions in this Community Tip for Quick Fix Ideas.

Let us know if you still need help when you tried the quick fix ideas. There are also a lot of threads here with more troubleshooting hints.

2 Likes

Cloudflare is able to but what I’ve heard from some others is that apache virtual hosts cant resolve the domain that the request is coming from if it is through cloudfare proxy

Can you share it?

Never heard about this. Which doesn’t mean that it isn’t possible. :sweat_smile:
Do you have shell access? Have a look at your Apache’s access.log and error.log while your A record is set to :orange:

tail -f /var/log/apache2/access.log
tail -f /var/log/apache2/error.log 
That's the default, it may vary depending on your config

At the moment I still think your server does not respond to requests through Cloudflare’s network at all.

EDIT:
And run ping 104.18.8.87 and post the results please.

Assuming your server IP address ends in 98 it would seem your server simply is not configured for HTTPS and does not listen on port 443.

Configure your server properly for HTTPS and set up a valid certificate and the site should be working.

I don’t have a ssl cert yet, why does the cloudflare proxy need ssl though?

That is obvious from aforementioned test.

How should your server be secure without SSL?

nevermind, I fixed it by turning the encryption on the cloudflare panel to “flexible”

Congrats, you achieved making your site insecure now :wink:

1 Like

but when I visit now it shows secure

As I asked you before

wait im so confused rn, when I visit it on chrome it says this site is secure

If you want a secure site install a certificate on your server and switch to “Full strict”.

1 Like

It’s like your website is a Halloween mask where the mouth is sealed, but your real mouth behind the mask is spilling secrets anybody nearby can hear. Chrome only looks at the public mask, not the real mouth behind the mask.

1 Like

ohhh ok gotit

1 Like