Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

SaaS Custom Hostnames, TLS Certificates, and Fallback Origin Routing

How SaaS providers add customer vanity domains on one zone, issue and renew TLS certificates, route traffic via fallback origins, and set per-tenant limits.

This page summarizes Cloudflare for SaaS documentation: extending edge security and performance to each tenant’s own domain (custom or vanity hostname) from a single provider zone, with automatic certificate lifecycle and scalable hostname management.

Cloudflare for SaaS: custom domains for multi-tenant apps

Section titled “Cloudflare for SaaS: custom domains for multi-tenant apps”

SaaS buyers often expect traffic on their domain (for example app.customer.com), not only a subdomain on yours. Cloudflare for SaaS lets you register those names as custom hostnames on your SaaS zone and proxy HTTPS through Cloudflare’s network before traffic reaches your application.

Cloudflare for SaaS allows you to extend the security and performance benefits of Cloudflare’s network to your customers via their own custom or vanity domains.

— Cloudflare, Cloudflare for SaaS

As the SaaS provider, you can support hostnames under your zone and vanity domains owned by customers:

Cloudflare for SaaS allows you, as a SaaS provider, to extend the benefits of Cloudflare products to custom domains by adding them to your zone as custom hostnames. We support adding hostnames that are a subdomain of your zone (for example, sub.serviceprovider.com) and vanity domains (for example, customer.com) to your SaaS zone.

— Cloudflare, Custom hostnames

Typical situations include large domain portfolios, dynamic per-customer subdomains, multi-tenant SaaS, and staging domains across many hostnames—patterns called out for advanced hostname handling such as Any Hostname (Enterprise only).

What problem custom hostnames solve at scale

Section titled “What problem custom hostnames solve at scale”

Per-customer edge “zones” or multi-domain certificates do not scale cleanly to thousands or millions of tenants. Cloudflare for Platforms is intended to manage many unrelated hostnames in one zone with shared configuration and per-hostname overrides where needed, as described in Leveraging Cloudflare for your SaaS applications.

How custom hostname traffic reaches your origin (fallback origin)

Section titled “How custom hostname traffic reaches your origin (fallback origin)”

Cloudflare for SaaS routes requests for each custom hostname to an origin on your infrastructure—often a single default target called the fallback origin.

As the SaaS provider, you can extend Cloudflare’s products to customer-owned custom domains by adding them to your zone as custom hostnames. Through a suite of easy-to-use products, Cloudflare for SaaS routes traffic from custom hostnames to an origin, set up on your domain.

— Cloudflare, Cloudflare for SaaS

In the usual pattern from Extend Cloudflare’s benefits to SaaS providers’ end-customers:

  1. The customer’s hostname (for example custom.example.com) is a CNAME to your fallback hostname (for example fallback.myappexample.com).
  2. The fallback origin is often an A record to your server’s public IP; Cloudflare sends custom-hostname traffic there by default.
  3. Your origin learns the tenant from the Host header or SNI, so one origin can serve many hostnames.

If the app runs on Workers, a Worker can act as that fallback origin. Cloudflare Tunnel can be combined with Cloudflare for SaaS to reach origins without opening inbound firewall ports.

Modern Cloudflare for SaaS (formerly SSL for SaaS v2) proxies by custom hostname, not by fixed anycast IPs on the SaaS zone—see Deprecation - Version 1. After creating a hostname you complete hostname verification in addition to certificate validation, which reduces risk compared to the older IP-based model.

Orange-to-Orange (O2O) when the customer already uses Cloudflare

Section titled “Orange-to-Orange (O2O) when the customer already uses Cloudflare”

If an end customer already proxies their site on Cloudflare, plan limits and feature control interact with your SaaS setup. Certificate and hostname priority gives a concrete case: a customer zone on a Free plan plus a SaaS provider on Enterprise using a wildcard custom hostname—the customer’s plan limits can win and the path is treated like a Free zone. Enterprise-level limits through Cloudflare for SaaS may require a DNS-only record on the customer side or an exact hostname match instead of a wildcard.

The design guide recommends that end customers often not proxy the hostnames used for your SaaS integration; when O2O is required, review product compatibility in Extend Cloudflare’s benefits to SaaS providers’ end-customers.

TLS certificates for every custom hostname (issue, validate, renew)

Section titled “TLS certificates for every custom hostname (issue, validate, renew)”

Certificate management is a core reason teams adopt this product.

Cloudflare for SaaS takes away the burden of certificate issuance and management from you, as the SaaS provider, by proxying traffic through Cloudflare’s edge. You can choose between Cloudflare managing all the certificate issuance and renewals on your behalf, or maintain control over your TLS private keys by uploading your customers’ own certificates.

— Cloudflare, Certificate management

For automatic provisioning:

SaaS customers expect to use their own domains (for example, app.theirdomain.com) instead of a subdomain on your platform. Cloudflare SSL for SaaS provisions and renews SSL certificates automatically for every custom hostname, with no manual steps or customer action required.

— Cloudflare, Customer domains with SSL for SaaS

Cloudflare can handle Domain Control Validation (DCV) on behalf of domains that send traffic to your platform on Cloudflare, so renewal is not a repeated manual token exercise for each customer—see Leveraging Cloudflare for your SaaS applications. Operational steps are outlined under Issue and validate certificates (issue, validate, renew).

Enterprise plans unlock custom certificates, CSR support, selectable CA, and related options per Plans; non-Enterprise tiers use Cloudflare-managed issuance by default.

Enable Cloudflare for SaaS and create custom hostnames

Section titled “Enable Cloudflare for SaaS and create custom hostnames”

Before creating hostnames, add your zone to Cloudflare, enable Cloudflare for SaaS, and read Hostname validation and certificate and hostname priority—wildcard custom hostnames behave differently from exact matches, as noted in Configuring Cloudflare for SaaS.

  1. In the Cloudflare dashboard, open the Custom Hostnames page for your zone.

  2. Select Enable. On Enterprise, eligible accounts may preview as a non-contract service with full access and no metered usage fees; otherwise contact the account team. On non-Enterprise, provide payment information—see Enable.

  3. Complete initial setup for the SaaS zone (fallback origin and related settings) before adding hostnames—see Configuring Cloudflare for SaaS.

  4. For each customer domain, create a custom hostname and walk through DNS and validation—Get started links Enable, configuration, advanced settings, and Common API Calls.

You can automate create, update, delete, and monitoring with the Custom Hostnames and fallback-origin APIs described in Common API Calls. Example create call from WAF for SaaS:

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"hostname": "<CUSTOM_HOSTNAME>",
"ssl": {
"wildcard": false
}
}'

Token permissions typically include SSL and Certificates Write and Create Custom Hostname (see the same page).

Hostname validation limits and common misconfigurations

Section titled “Hostname validation limits and common misconfigurations”

Validation fails if the customer’s DNS setup hides ownership from Cloudflare:

Custom hostnames using another CDN are not compatible with Cloudflare for SaaS. Since Cloudflare must be able to validate your customer’s ownership of the hostname you add, if their usage of another CDN obfuscates their DNS records, hostname validation will fail.

— Cloudflare, Hostname validation

Custom hostname must not equal the SaaS zone name

Section titled “Custom hostname must not equal the SaaS zone name”

Do not configure a custom hostname which matches the zone name. For example, if your SaaS zone is example.com, do not create a custom hostname named example.com.

This configuration will cause a 403 Forbidden error due to DNS override restrictions applied for security reasons.

— Cloudflare, Troubleshooting

Interpret status values using Status codes.

Per-tenant security and performance (WAF, custom metadata)

Section titled “Per-tenant security and performance (WAF, custom metadata)”

Cloudflare for SaaS extends DDoS protection, WAF, rate limiting, caching, Early Hints for SaaS, and related edge features to each custom hostname—see Security and Performance.

Custom metadata (Enterprise add-on) tags each hostname so rules and Workers can treat tenants differently:

You may wish to configure per-hostname (customer) settings beyond the scale of Rules or Rate Limiting.

— Cloudflare, Custom metadata

Patch metadata on a hostname ID; changes propagate across the edge within about 30 seconds—same document. WAF for SaaS ties metadata (for example security_level) to WAF and rate limits; managed rulesets for SaaS require Enterprise.

Cloudflare Access on a custom hostname applies only when that hostname is managed outside Cloudflare or in a separate account from the SaaS zone.

Waiting Room can be used when the app is served through a SaaS provider’s custom hostname configuration.

Plans, quotas, and billing for custom hostnames

Section titled “Plans, quotas, and billing for custom hostnames”

Cloudflare for SaaS is bundled on non-Enterprise plans and available as an add-on on Enterprise. Highlights from the published plan table:

Topic Free / Pro / Business Enterprise
Hostnames included 100 each Custom
Max hostnames 50,000 Unlimited (contact sales above 50,000)
Price per extra hostname $0.10 Custom
Wildcard custom hostnames No Yes
Custom metadata No Paid add-on
WAF for SaaS Zone plan WAF rules Custom firewall rulesets
Custom certificates No Yes

Quotas and billing points to Plans for included and maximum hostnames. Monitor usage with:

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/quota" \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"

Fields allocated, used, exceeded, and hard_cap are documented on that page (exceeded is true when used ≥ allocated).

Eligible Enterprise customers may preview the product as a non-contract service with full access and without certain usage limits—notes on Cloudflare for SaaS and Plans.

  1. In the Cloudflare dashboard, open Custom Hostnames for your SaaS zone and confirm each customer hostname is Active with SSL issued—follow Issue and validate certificates.

  2. From the customer’s DNS, verify the CNAME (or apex setup if using apex proxying setup) points at your documented fallback target as in Extend Cloudflare’s benefits to SaaS providers’ end-customers.

  3. Call the custom hostname quota endpoint and compare used to allocated.

  4. If hostname or certificate state is unclear, cross-check Status codes and Troubleshooting.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about.