Using Cloudflare with Shopify

Shopify is a service for building and operating your own ecommerce websites on a dedicated hosting platform. Cloudflare can be used with Shopify stores if you have your own custom domain (example: yourdomain.com). Below are instructions for setting up Cloudflare and Shopify.

What do you need to get started?

Instructions

To configure Shopify with Cloudflare, follow these steps:

1. Log in to your Shopify account.

2. Go to the admin panel and click on “Settings”.

3. Click on “Domains”, then on the next page click “Add an existing domain”.


4. On the popup select “Add a domain name I already own” and type in your domain name.

5. Create an A record within your Cloudflare DNS settings page that is named after your domain name. Then point that record to the IP address Shopify.com provides.

Note: Shopify might assign a different IP address to your account.

yourdomain.com A points to Shopify IP 

Alternatively, you can run Shopify under a subdomain (e.g. shop.yourdomain.com) using the same IP by repeating step 3 and add shop.yourdomain.com as an existing domain. In your Cloudflare DNS settings add the following A record and point it at the Shopify IP we got earlier.

shop.yourdomain.com A points to Shopify IP

Once this is done you may remove the root domain from shopify which gives you the ability to point your root domain (yourdomain.com) to a separate website.

 

Using Cloudflare's SSL with Shopify

In order to use SSL with Shopify, you have two options:

  • If your online store is not eligible for SSL certificates - use the Full SSL setting on Cloudflare.
  • If your online store is eligible for SSL certificates and you have activated SSL on Shopify - use the Full(strict) SSL setting on Cloudflare.

What Cloudflare features work with Shopify?

  • The Cloudflare CDN will cache static resources that are hosted within your Cloudflare enabled domain (any/all subdomains included), but resources loaded through shopify.com domain and subdomains will not go through Cloudflare.
  • DDoS protection and Web Application Firewall (WAF) services work seamlessly with Shopify to ensure your site is always online and protected from hackers. Please note that your site must be “orange clouded” (active on Cloudflare) to receive this protection, and that your admin and checkout pages are still on Shopify’s domain, and, therefore, not protected by Cloudflare.
  • Hotlink protection is incompatible with Shopify because most of the resources are loaded from shopify.com. Only resources that are hosted within your Cloudflare-enabled domain can benefit from this feature.
  • Rocket Loader works on standard Shopify pages, but may interfere with third-party scripts.
  • HTML Minifying works, but JS and CSS minifying will only work for resources that are hosted within your Cloudflare-enabled domain.
  • Cloudflare Page Rules may be used for additional caching, forwarding, and customization.
Still not finding what you need?

The CloudFlare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk