Is it possible to use CloudFlare with Fastly CDN


Is it possible to use Cloudflare alongside Fastly (a CDN)

We want to do something like this:

serves up content from:

We have registered and set up beautifully with Cloudflare, and all working well, SSL loading, returning a 200 header etc.

However, when routing the traffic to and from what gets returned is a 403 from Cloudflare

Is there something special we need to turn on or off or configure? Thanks!

That won’t work without a bit of configuration. You need to allow that host to access the site on the server. It shouldn’t be related to Cloudflare. It would work this way even if Cloudflare wasn’t there.

1 Like

Thanks for your reply Matteo! We can offer them an IP address to connect direct to the server instead (bypassing Cloudflare) but just not sure if that’s the best route to go, we’d like to route through Cloudflare if possible.

I have never tried a CNAME to a Cloudflare enabled host, but in theory it should work just the same as anything else. Probably @cs-cf is the best person to ask. The thing is that the server needs to allow requests as that origin and reply accordingly.

I mean technically Cloudflare is a CDN as well, there really isn’t a need for two in most instances… But I get it, I have customers with existing infrastructure, contracts, political issues so it’s not an unheard of configuration to use another CDN behind Cloudflare. Yes, it’s possible.

Ok, so is using Cloudflare. And it works. Because of the sample domains names I’m a bit unclear. Is different using Cloudflare? Is it on Fastly? Do you own/control both and

For the moment I am going to assume that you manage both domains and is on Fastly based on the question. In Fastly are you overwriting the host header to If you do a curl direct to Cloudflare in this instance bypassing Cloudflare, does it return an error?

curl -Ikv -H “Host:” --resolve

(Might double-check the -H syntax, but pretty sure the rest is correct).

Hi again,
that’s perfect thank you for the information…

Actually the client has access to the fastly configuration and their domain, I have no access at all. But good news is: they managed to get it all working with no changes at all on Cloudflare configuration. I’m not sure exactly what they did… but yes it works :slight_smile:

Massive thanks again… I didn’t know if this would ever work!

This topic was automatically closed after 14 days. New replies are no longer allowed.