cPanel Origin Server - Restricting access to Cloudflare IPs

We are a customer of a shared hosting provider using cPanel. I would like to restrict our website so that we only receive connections to the site via Cloudflare IPs.

What’s the best way to achieve this?

You’d want some form of cron task that fetches https://www.cloudflare.com/ips-v4 and https://www.cloudflare.com/ips-v6 to keep your firewall rules up-to-date & make sure that only they are allowed to reach your origin.

1 Like

Thanks for that! I don’t have access to the firewall rules, I only have access to the cPanel console. I’m also using a shared IP.

Is there anything else you could recommend?

Hmm - in that case, your best bet is setting up Authenticated Origin Pulls.

Whilst traffic can still reach your website, they’ll be rejected since your website will be configured to verify that the client loading your website presents Cloudflare’s certificate.

https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/set-up/

1 Like

Looks like cPanel won’t even let me configure that! I’ll leave it for the time being, not much I can do about it.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.