Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

Object Storage Connector Rules, Routing, and Provider Hostnames

How Cloudflare Cloud Connector routes proxied site traffic to public object storage using rules, match expressions, and provider-specific host parameters.

This page summarises Cloudflare documentation on Cloud Connector, which lets you send matching HTTP requests from a zone to public object storage on Cloudflare R2 or on AWS, Google Cloud, Azure, or Oracle Cloud—without a separate custom origin stack for every path.

Cloud Connector: what it is and when you use it

Section titled “Cloud Connector: what it is and when you use it”

Cloud Connector is for teams that already proxy a hostname through Cloudflare and want some URLs (by path, host, geography, headers, and similar signals) to be satisfied from a public storage bucket instead of the default origin.

Cloud Connector (Beta) allows you to route matching incoming traffic from your website to a public cloud provider that you define: Cloudflare R2 object storage or an external provider such as AWS, Google Cloud, Microsoft Azure, and Oracle Cloud. With Cloud Connector, you can manage traffic to cloud-hosted content through the same Cloudflare dashboard you use for the rest of your website, without having to configure additional rules.

— Cloudflare, Cloud Connector

Typical situations include serving /images/* from S3, sending EU visitors to a GCS bucket, exposing /static-assets from Azure Blob Storage, or routing assets to Oracle Cloud Infrastructure (OCI) Object Storage after that provider was added to the product.

Prerequisites: proxied DNS and public buckets

Section titled “Prerequisites: proxied DNS and public buckets”

Cloud Connector only applies to traffic Cloudflare already terminates for your zone.

Cloud Connector requires that you proxy the DNS records of your domain (or subdomain) through Cloudflare.

— Cloudflare, Cloud Connector

Your bucket (or R2 custom domain) must allow anonymous reads at the edge. Cloud Connector does not sign requests or inject cloud credentials. Private buckets, locked-down containers, and OCI pre-authenticated request (PAR) URLs are outside what the connector can use.

For OCI specifically:

Cloud Connector does not sign requests or provide OCI credentials. Your bucket must allow anonymous object reads. Private buckets and pre-authenticated request URLs are not supported.

— Cloudflare, Oracle Cloud Infrastructure Object Storage support in Cloud Connector

How Cloud Connector rules work in the request path

Section titled “How Cloud Connector rules work in the request path”

A rule pairs which requests match with which provider hostname receives the forwarded request.

First, you configure a Cloud Connector rule that specifies:

The cloud provider and a supported cloud service that will accept traffic. The traffic that will be routed to that cloud service.

Then, Cloudflare will create the necessary configurations so that the content is accessible for requests matching your Cloud Connector rule. Your object storage bucket must be publicly accessible for Cloud Connector to work.

— Cloudflare, Cloud Connector

Evaluation order matters when you combine Cloud Connector with other rules:

Cloud Connector rules are evaluated last in the request evaluation workflow. When a Cloud Connector rule matches and other rules have modified the same settings (such as the Host header), the Cloud Connector rule takes precedence.

— Cloudflare, Cloud Connector

What Cloud Connector changes automatically

Section titled “What Cloud Connector changes automatically”

Depending on the provider, Cloudflare may adjust the Host header and, for AWS S3 website endpoints only, SSL/TLS toward the bucket. It does not enable caching or path rewriting—you add those separately if you need them (Cache Level (Cache Everything) is referenced from the main doc; path rewrites are covered in Rewrite path for object storage bucket).

Supported providers and provider API values

Section titled “Supported providers and provider API values”

Supported cloud providers in Cloud Connector lists five backends. In the API and Terraform, each maps to a fixed provider string:

Storage service provider value Notes from documentation
Cloudflare R2 cloudflare_r2 Public bucket on a custom domain in the same zone as the rule; r2.dev subdomains are not supported
Amazon S3 aws_s3 Subdomain or path-style hostnames; SSL mode affects HTTPS to regional endpoints
Google Cloud Storage gcp_storage *.storage.googleapis.com or *.storage.cloud.google.com
Azure Blob Storage azure_storage Subdomain only: *.blob.core.windows.net or *.web.core.windows.net
OCI Object Storage oci_storage S3 compatibility API; path-style or virtual-hosted hostnames

The provider value must be one of the following: cloudflare_r2, aws_s3, azure_storage, gcp_storage, and oci_storage.

— Cloudflare, Configure a Cloud Connector rule via API

The Cloudflare R2 bucket must be public and exposed using a custom domain. Buckets exposed using an r2.dev subdomain are not supported.

Additionally, the custom domain must be defined in the same zone where you are configuring the Cloud Connector rule.

— Cloudflare, Supported cloud providers in Cloud Connector

R2 rules can match more than paths—for example URLs, headers, or geolocation—as noted when R2 support shipped:

Now, you can use Cloud Connector to route traffic to your R2 buckets based on URLs, headers, geolocation, and more.

— Cloudflare, Cloud Connector Now Supports R2

Allowed hostname patterns include *s3.amazonaws.com, regional *s3.<REGION>.amazonaws.com, and S3 website endpoints. Subdomain-style hosting maps the visitor path directly under the bucket root; path-style hosting puts the bucket name in the URI path on your site. Under Full (Strict) TLS, bucket names with dots are problematic—use dashes instead (SSL connections to AWS S3 endpoints in the providers page).

Google Cloud Storage and Azure Blob Storage

Section titled “Google Cloud Storage and Azure Blob Storage”

GCS follows the same subdomain versus path-style split as S3 (Google Cloud Platform - Cloud Storage). Azure is subdomain-only: files live under the container path that mirrors your public URL (see Serve /static-assets from Azure Blob Storage).

OCI support uses the Amazon S3 Compatibility API with both path-style and virtual-hosted endpoints:

OCI support uses the Amazon S3 Compatibility API. Both path-style and virtual-hosted endpoint formats are supported, including traditional oraclecloud.com and dedicated customer-oci.com path-style endpoints.

— Cloudflare, Oracle Cloud Infrastructure Object Storage support in Cloud Connector

Addressing style Hostname format Request path on OCI
Path style (traditional) <NAMESPACE>.compat.objectstorage.<REGION>.oraclecloud.com /<BUCKET_NAME>/<OBJECT_NAME>
Path style (dedicated) <NAMESPACE>.compat.objectstorage.<REGION>.oci.customer-oci.com /<BUCKET_NAME>/<OBJECT_NAME>
Virtual-hosted style <BUCKET_NAME>.vhcompat.objectstorage.<REGION>.oci.customer-oci.com /<OBJECT_NAME>

For path-style hosts, include the bucket name in the visitor URL path; for virtual-hosted hosts, the bucket name is only in parameters.host (Oracle Cloud Infrastructure Object Storage).

Match expressions: how to send only some traffic to storage

Section titled “Match expressions: how to send only some traffic to storage”

In the dashboard you choose a provider and bucket URL, then define If traffic with either All incoming requests or a custom filter (Configure a Cloud Connector rule in the dashboard).

Common patterns from examples:

If your public URL structure does not match object keys, add a Transform Rule rewrite before Cloud Connector—for example stripping a /files/ prefix (Rewrite path for object storage bucket).

Create Cloud Connector rules: dashboard, API, and Terraform

Section titled “Create Cloud Connector rules: dashboard, API, and Terraform”
  1. Open Cloud Connector in the Cloudflare dashboard for the zone.
  2. Select Cloudflare R2 or an external provider; for R2, pick the bucket and custom domain, otherwise enter the bucket URL.
  3. Name the rule, set If to a custom expression or all incoming requests, then Deploy (or Save as Draft).
  4. If the expression mentions a hostname that is not yet proxied, follow dashboard prompts to add the DNS record.

Base URL: https://api.cloudflare.com/client/v4. Manage rules at:

  • GET /zones/{zone_id}/cloud_connector/rules — list
  • PUT /zones/{zone_id}/cloud_connector/rules — create, update, or delete

The token needs Zone > Cloud Connector > Write for changes (Configure a Cloud Connector rule via API). That permission applies only to these endpoints, not the Rulesets http_cloud_connector phase.

Each rule body requires expression, provider, and parameters.host. Example for R2:

{
"expression": "http.request.uri.path wildcard \"/images/*\"",
"provider": "cloudflare_r2",
"description": "Connect to R2 bucket containing images",
"parameters": {
"host": "mybucketcustomdomain.example.com"
}
}

OCI virtual-hosted example from the changelog:

{
"expression": "http.request.uri.path wildcard \"/assets/*\"",
"provider": "oci_storage",
"description": "Route assets to OCI Object Storage",
"enabled": true,
"parameters": {
"host": "<BUCKET_NAME>.vhcompat.objectstorage.<REGION>.oci.customer-oci.com"
}
}

List rules with:

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cloud_connector/rules" \
--request GET \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"

The Terraform configuration example uses cloudflare_cloud_connector_rules with one rules block per path and provider. A single-zone S3 /images route is spelled out in Route /images to an S3 Bucket using Terraform.

More walkthroughs—including S3, GCS, Azure, and multi-provider path splits—are indexed under Cloud Connector examples.

Cloud Connector forwards to storage; it does not by itself cache responses. For long TTLs at the edge, add a Cache Rule (the S3 images example uses a seven-day Edge TTL for /images/* in Route /images to an S3 Bucket).

Documentation also suggests restricting bucket network policies to Cloudflare IP addresses once objects are public but should only be fetched via your zone.

Mistake Why it fails
DNS record DNS-only (grey cloud) Connector never runs; proxying is mandatory
Private bucket or PAR-only OCI URLs No signing; anonymous read required
R2 on r2.dev or custom domain in another zone Provider page rejects those R2 setups
Path-style S3/GCS host but keys not under matching prefixes Visitor path must align with bucket layout
API PUT with only the new rule Drops all other connector rules
Expecting cache or /files/ stripping by default Requires separate Cache and URL Rewrite rules
  1. In the Cloudflare dashboard, open Cloud Connector for the zone and confirm the rule is Deployed with the intended expression and provider host.
  2. Call GET /zones/{zone_id}/cloud_connector/rules as in Configure a Cloud Connector rule via API and verify expression, provider, and parameters.host match production.
  3. Request a URL that should match (for example /images/test.jpg or an EU client hitting a geo rule) over HTTPS through the proxied hostname and confirm the object loads with the expected status and content type.
  4. If paths look wrong, review Transform Rules and compare your URL layout to the provider tables in Supported cloud providers in Cloud Connector.
  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 statement you are asking about, and we will correct or clarify it.