Cloudflare & Shopify: The Big Fix That Makes It Safe (Finally!)

Hey fellow store owners! Let's talk about something that's been a bit of a headache for a while: putting Cloudflare in front of your Shopify store. For years, it was a setup many of us avoided, and for good reason. It could cause all sorts of nasty issues, from redirect loops to silently failing SSL certificate renewals. But there's good news from the community, and it's a game-changer.

I’ve been diving deep into a fantastic discussion on the Shopify forums, kicked off by wislr, who ran a test store specifically to get to the bottom of this. And honestly, the insights shared by sophia24, Hardeep, and Steve_TopNewYork have been incredibly valuable. It turns out, that “thing that used to break it”? It’s largely been fixed!

The Old Headache: Why Cloudflare and Shopify Didn't Mix Well

Before we celebrate, let’s quickly recap why this was such a pain. Shopify, by default, actually uses Cloudflare itself. So, when you tried to put your *own* Cloudflare-proxied domain in front of your Shopify store, you'd essentially have two Cloudflare zones trying to claim the same request. This often led to confusion, redirect loops, and “wrong resolutions.” Imagine two bouncers at the same club entrance, both insisting they're in charge — chaos!

The nastiest problem, as wislr pointed out, was with SSL certificate renewals. Shopify renews its certificates through Let’s Encrypt. This process requires serving a specific token over plain HTTP at a path like /.well-known/acme-challenge/. If your Cloudflare proxy was set up incorrectly, it would “swallow” this path, silently failing the renewal. Your store would keep working on an expiring certificate for weeks, and then — boom! — the padlock breaks, and your customers see scary security warnings.

The Game-Changer: Cloudflare's Orange-to-Orange (O2O) Routing

Here’s where things get exciting. Cloudflare introduced something called Orange-to-Orange (O2O) routing. This feature, which has been generally available since October 2021, specifically addresses the zone collision problem. How? Cloudflare now intelligently detects that your CNAME points to another Cloudflare customer (Shopify, in this case). It then routes the request through *your* zone first, and *then* through Shopify’s zone, in the correct order.

You can actually tell if O2O is engaged because you’ll see a small Shopify icon next to your DNS record in Cloudflare. Pretty neat, right? Plus, Cloudflare takes extra precautions: it turns off Workers and Snippets on the /checkout path. This ensures that nothing you’re running at the edge can interfere with the critical payment process, which is a huge relief for any merchant.

Setting It Up Right: Your Step-by-Step Guide to a Smooth Cloudflare-Shopify Integration

So, if you’re thinking about leveraging Cloudflare’s features, here’s the critical configuration, distilled from wislr’s testing and community feedback:

  1. Proxied CNAME for Root and www: Set your CNAME record to point to shops.myshopify.com. Make sure this is “proxied” (the orange cloud in Cloudflare). Do this for both your root domain (e.g., yourstore.com) and your www subdomain (e.g., www.yourstore.com).
  2. Connect Domain in Shopify: Go into your Shopify admin and connect this same custom domain. Shopify needs to know you’re using it!
  3. The CRUCIAL SSL Setting: Leave “Always Use HTTPS” OFF in Cloudflare. This is the part that many merchants, including myself in the past, get wrong. Shopify already handles the redirect from HTTP to HTTPS at its origin. If you turn on “Always Use HTTPS” in Cloudflare, you’re stacking a second redirect, which can lead to “ERR_TOO_MANY_REDIRECTS” errors. More importantly, as sophia24 and Hardeep highlighted, it also prevents the ACME challenge path from working, meaning your SSL certificates won't renew!

Instead of the “Always Use HTTPS” toggle, keep your SSL mode in Cloudflare set to “Full.” While you’re there, it’s a good idea to set the minimum TLS to 1.2 for modern security standards. If you absolutely need Cloudflare to enforce HTTPS at its edge, you can write a specific redirect rule that *excludes* the challenge path (/.well-known/acme-challenge/) instead of using the problematic toggle.

How to Verify Your Setup

To make sure everything is working as expected, wislr shared a great verification tip: use curl against the challenge path over plain HTTP. You should expect a 404 for a fake token. This means your request successfully reached Shopify. If you get a 301 or 308 redirect, something is still “eating” the path, and you need to recheck your Cloudflare settings.

curl -I http://yourstore.com/.well-known/acme-challenge/faketoken

Understanding the “Not Supported” Warning

Even with O2O, you might still see an “unsupported issue” warning in Shopify’s domain settings. Don’t panic! As wislr clarified, this simply means Shopify won’t guarantee or debug a layer they don’t control. It doesn’t mean the setup fails. Shopify has a few reasons for this stance:

  • An extra proxy layer can complicate their Let’s Encrypt renewal process.
  • It makes it harder for Shopify to reroute traffic during their own incidents.
  • Their third reason is bot detection, though wislr makes a strong point that Cloudflare’s bot management is often superior, potentially offering *more* filtering than Shopify might lose in request signal.

What about latency? That was a concern for many, but it turns out to be a non-issue. Both your Cloudflare zone and Shopify’s sit on the same global network, so the handoff happens internally. Tests showed minimal to no difference in response times. If your store feels slow, as Hardeep and Steve_TopNewYork wisely suggested, you should probably look at your theme optimization and app stack first.

Is Cloudflare Right for YOUR Shopify Store?

This is the million-dollar question, and the community had a clear consensus: only if you truly need Cloudflare's advanced edge features.

If you’re looking for things like:

  • A highly tunable Web Application Firewall (WAF)
  • Advanced rate limiting
  • Detailed request-level logs
  • Visibility into AI crawlers (GPTBot, ClaudeBot, PerplexityBot, etc. — these don’t run JavaScript, so GA4 and Shopify analytics often miss them, but Cloudflare sees them at the edge!)

...then Cloudflare can be a powerful addition. It gives you an incredible amount of control and insight that Shopify’s default setup doesn’t offer.

However, if you can’t name a specific feature you need, then adding Cloudflare might be introducing unnecessary complexity. As sophia24, Hardeep, and Steve_TopNewYork all emphasized, every extra layer adds another point of failure and another component to troubleshoot. Shopify already provides a CDN, SSL, and DDoS protection out of the box, which is more than sufficient for many, many stores.

The decision ultimately comes down to a trade-off: the added control and security features vs. the increased complexity and the need to actively monitor things like SSL renewals yourself. If you do decide to go this route, remember to test all SSL renewals and redirects carefully after any DNS or Cloudflare configuration changes. Thanks to the folks in the community, we now have a much clearer picture of how to make this work reliably, and when it’s truly worth the effort!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools