Extend Cloudflare's benefits to SaaS pro·续
Cloudflare Tunnel as fallback origin setup with regional services
For enhanced security, rather than exposing your application servers directly to the Internet via public IPs, SaaS providers can use Cloudflare Tunnels. These tunnels connect your network to Cloudflare's nearest data centers, allowing SaaS applications to be accessed through public hostnames. As a result, Cloudflare becomes the sole entry point for end-customers from the public Internet into your application network.

Figure 3: Cloudflare Tunnel as Fallback Origin Setup with Regional Services.
- The custom hostname (
custom.example.com) is configured as a CNAME record that points to a regionalized SaaS hostname (eu-customers.myappexample.com). This configuration ensures that all processing, including TLS termination, occurs exclusively within the specified geographic region. - The regionalized SaaS hostname is set up as a CNAME record that directs traffic to the standard Fallback Origin of the SaaS provider (
fallback.myappexample.com). - The fallback origin is a CNAME DNS record that points to a public hostname exposed by Cloudflare Tunnel. This public hostname should be configured to route traffic to your application, for example,
localhost:8080.
This setup is ideal for SaaS providers that do not need granular load balancing, such as geo-based traffic steering, across multiple origin servers. It's also well-suited for simple testing and development environments, where protecting your origin server by only allowing requests through the Cloudflare Tunnel is sufficient. However, for distributed applications requiring load balancing at both global and local levels, we recommend using Cloudflare's Load Balancer with global and private network load balancing capabilities.
Global Traffic Management (GTM) & Private Network Load Balancing as custom origin setup
Cloudflare offers a powerful set of load balancing capabilities. These allow you to reliably steer traffic to different origin servers where your SaaS applications are hosted, whether through public hostnames (as described above) or private IP addresses. This setup helps prevent origin overload by distributing traffic across multiple servers and enhances security by only permitting requests through the Cloudflare Tunnel.

Figure 4: Global Traffic Management (GTM) & Private Network Load Balancing as custom origin setup.
- The custom hostname (
custom.example.com) is configured as a CNAME record pointing to a Cloudflare regionalized Load Balancer (eu-lb.myappexample.com). This ensures that all processing, including TLS termination, takes place within a specified geographic region. Additionally, the SaaS provider needs to set up the load balancer as the custom origin for the custom hostname. - The regional load balancer is set up with origin pools to distribute requests across multiple downstream servers. Each pool can be configured to use either public hostnames with Global Traffic Management (GTM) or private network addresses with Private Network Load Balancing. In the diagram above, we utilize both options:
- Origin pool 1 uses the Cloudflare Tunnel hostname (
<UUID>.cfargotunnel.com) as the endpoint or origin server for handling those requests. When using a public hostname, it is necessary to set the HTTP host header value to match the public hostname configured and exposed by the Cloudflare Tunnel. This ensures that the origin server can correctly route the incoming requests. - Origin pool 2 uses the private IP address or private network (that is,
10.0.0.5) within the SaaS provider's internal network, where the SaaS application resides. This pool must be configured to operate within the specified virtual network to ensure proper routing of requests. - Cloudflare Tunnel exposes both public hostnames with GTM and private networks (private IPs) with Private Network Load Balancing.
For enhanced granularity in application serving and scalability, it is generally recommended to use private networks rather than public hostnames. Private networks enable Cloudflare to preserve and accurately pass the host header to the origin server. In contrast, when using public hostnames, providers must configure the header value on the load balancer, which is restricted to one public hostname per load balancer endpoint, potentially limiting flexibility.
Before you design your deployment, review the following:
- Cloudflare Tunnel limits. If you deploy one tunnel per end customer and need more than 1,000 tunnels in a single account, use Tunnels for Platforms.
- Cloudflare for SaaS connection request details.
- SNI rewrites for custom origins.
- The Cloudflare Load Balancing reference architecture.
Automation
As a SaaS provider, it is advisable to automate most, if not all, of these processes using APIs, SDKs, scripts, Terraform, or other automation tools.
An example of a high-level migration plan can be downloaded here.
It is highly recommended to migrate to Cloudflare for SaaS in phases and address any issues as they arise, particularly with Domain Control Validation (DCV). Be sure to review the validation status and relevant documentation during the process.
Summary
By leveraging Cloudflare's infrastructure, SaaS providers can deliver secure, reliable, and performance services to their end-customers. This ensures a seamless and secure user experience while meeting compliance requirements, such as regionalization.
Several Cloudflare customers are currently using the Cloudflare for SaaS solution (formerly known as SSL for SaaS). Notable public use cases include:
Additionally, when migrating to Cloudflare for SaaS, it is crucial to have a runbook and clear public documentation to communicate relevant details to your end-customers. Excellent public examples of this are the Salesforce CDN ↗︎ and Shopify ↗︎ documentation.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/reference-architecture/design-guides/extending-cloudflares-benefits-to-saas-providers-end-customers/#page","headline":"Extend Cloudflare's benefits to SaaS providers' end-customers","description":"Learn how to use Cloudflare to extend performance, security, and data localization to your end users.","url":"https://developers.cloudflare.com/reference-architecture/design-guides/extending-cloudflares-benefits-to-saas-providers-end-customers/","inLanguage":"en","image":"https://developers.cloudflare.com/reference-architecture/design-guides/extending-cloudflares-benefits-to-saas-providers-end-customers/og.png?v=a61dddf8204fd8ff","dateModified":"2026-10-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: This document provides a reference and guidance for using Cloudflare for Platforms. It is designed for SaaS application owners, engineers, or architects who want to learn how to make their application more scalable and secure. title: Leveraging Cloudflare for your SaaS applications image: https://developers.cloudflare.com/reference-architecture/design-guides/leveraging-cloudflare-for-your-saas-applications/og.png?v=b7b42190bb5bd7d9
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/reference-architecture/llms.txt
Use this file to discover all available pages before exploring further.
