Leveraging Cloudflare for your SaaS applications

Last updated Mar 4, 2026

Introduction

When building a SaaS application, it is common to create unique hostnames for each customer account (or tenant), for example app.customer.com. It is important to ensure that all communication to this application hostname is done using SSL/TLS and therefore a certificate must be created for your customer's hostname on your application. Certificate management is hard, and often application architects and developers would use a multi-domain certificate ↗︎ (MDC), so they can buy and add just one certificate that has hundreds of domains listed. However, this does not scale well when your application reaches thousands and millions of customers.

Also, a customer of your application might wish to have their main website domain hosted directly on your application. So that, for example, www.customer.com is actually delivering content directly from your SaaS application.

Many SaaS applications have caching and security solutions, such as Cloudflare, in front of their applications and as such need to onboard these hostnames. This is often done using a "Zone" model, where inside Cloudflare, or another vendor such as AWS Cloudfront, a "Zone" is created for app.customer.com. This means that, as each new customer is onboarded, a new "Zone" must be created - this might be manageable in the tens and hundreds of customers but, when you get to thousands and millions, management of all these zones and their configurations is hard.

Cloudflare for Platforms extends far beyond this traditional model of most edge providers, by managing traffic across many hostnames and domains in one "Zone". You can now manage www.customer1.com and www.customer2.net, and millions more hostnames, through the same configuration while also customizing features as needed.

This document provides a reference and guidance for using Cloudflare for Platforms. The document is split into three main sections.

  • Overview of the SaaS model and the common challenges Cloudflare for Platforms solves
  • SSL certificate issuance in a SaaS model
  • Customizing the experience for each of your clients

Who is this document for and what will you learn?

This reference architecture is designed for SaaS application owners, engineers, or architects who want to learn how to make their application more scalable and secure through Cloudflare.

To build a stronger baseline understanding of Cloudflare, we recommend the following resources:

  • What is Cloudflare? | Website ↗︎ (5 minute read) or video ↗︎ (2 minutes)
  • Cloudflare Ruleset Engine - We will discuss integrations with the ruleset engine. Familiarity with that feature will be helpful.
  • Cloudflare Workers - We will also discuss integrations with Cloudflare Workers, our serverless application platform. A basic familiarity with this platform will be helpful.

Those who read this reference architecture will learn:

  • How Cloudflare's unique offering can solve key challenges for SaaS applications
  • How to customize the Cloudflare experience for each of your end customers
  • Tools to integrate serverless applications, for each of your clients, through Workers for Platforms

Why Cloudflare for Platforms?

The SaaS model

Software as a Service (SaaS) has been a key innovation of the cloud computing era. On premises managed legacy enterprise software - such as accounting, HR, and CRMs - required dedicated attention from IT personnel to establish a platform (whether dedicated hardware, VMs, or cloud instances) for each application in the enterprise. The SaaS model allows providers, like Shopify and Salesforce, to extend their own platform to their customers instead. Now, the customer does not have to provision hardware or consider any other infrastructure concerns; instead, they subscribe to access to the SaaS platform which is always up to date, secure and available.

Third party hostname challenges

For many SaaS applications, it is important to provide a service under the client's own domain. Their domain is important for branding, security, and organization; and many clients have heavily invested in the right .com to represent their business. Many clients with domains linked to their brand will push back against deploying their applications on the provider's domain.

This is especially true for customer-facing applications like an e-commerce solution. You would want to expose this as shop.example.com, not example.shop.com. To secure traffic to the SaaS application, the provider ("shop") needs a certificate for their customer, example.com.

Figure 1: eCommerce flow through a SaaS platform.

Figure 1: eCommerce flow through a SaaS platform.

This is a challenge for SaaS solutions, as certificate issuance is tightly controlled through the DCV Validation process. The owner of a domain needs to authorize any certificates, and traditional methods of validation are driven by the domain owner and deliver the certificate only to them.

Figure 2: Certificates cannot be automatically renewed on legacy platforms. They will expire and break traffic without manual action.

Figure 2: Certificates cannot be automatically renewed on legacy platforms. They will expire and break traffic without manual action.

This poses a dilemma: the SaaS model offers clear advantages but introduces a new challenge of its own. A novel solution would let providers and end customers both get the most out of the SaaS model.

Issuing SSL certificates through Cloudflare for Platforms

Manage certificates for any hostname on the Internet

Cloudflare for SaaS provides a unique solution to these common challenges for SaaS providers. By leveraging Cloudflare's position as a low-latency, global network, we can transparently manage certificate issuance for end clients while also providing several other benefits to a SaaS platform.

Secure and powerful validation modes

Cloudflare has a unique ability to manage the Domain Control Validation (DCV) process in a SaaS scenario. In a traditional model, certificate issuers ask domain owners to place a particular token (either a DNS TXT record or a small text file) at their origin in order to validate that they are authorized for that domain. This has to be done repeatedly at certificate renewal, which has become more common with recent security improvements.

Figure 3: The DCV process.

Figure 3: The DCV process.

Since Cloudflare's network can easily sit in between the client and the SaaS provider, we can automatically respond with the correct DCV token on behalf of any domain that points traffic to the SaaS provider on Cloudflare.

Figure 4: Certificates automatically renew on Cloudflare-enabled platforms.

Figure 4: Certificates automatically renew on Cloudflare-enabled platforms.

Instead of repeatedly performing a complex process at every certificate renewal, the client performs a much simpler process only once.