You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,14 @@ To route requests to `/images` on your domain to an AWS S3 bucket:
16
16
-**Subdomain-style URL**: Set the hostname to `<BUCKET_NAME>.s3.amazonaws.com`. In this case, your files should be organized in the root of the bucket, meaning the URI path will map directly to the file. For example, `https://<YOUR_HOSTNAME>/images/file.jpg` will map to `https://<BUCKET_NAME>.s3.amazonaws.com/images/file.jpg`.
17
17
-**URI path-style URL**: Set the hostname to `s3.amazonaws.com`. Here, your bucket must include a folder named `images`, and files should be placed inside this folder. The URI path will then include the bucket name, like `https://<YOUR_HOSTNAME>/<BUCKET_NAME>/images/file.jpg` mapping to `https://s3.amazonaws.com/<BUCKET_NAME>/images/file.jpg`.
18
18
5._(Optional)_ Use [URL Rewrite Rules](/rules/transform/url-rewrite/) to adjust the URL structure. For example, you can [create a URL rewrite](/rules/transform/url-rewrite/create-dashboard/) that changes `/images` to `/<BUCKET_NAME>/images` to match the URI path-style URL structure.
19
-
6. Select **Next** and enter a descriptive name like `Route images to S3` in **Cloud Connector name**.
20
-
7. Under **If**, select **Custom filter expression** and enter the following expression:<br />
19
+
6._(Optional)_ Use [Cache Rules](/cache/how-to/cache-rules/) to adjust the caching behavior for objects returned from the bucket. For example, you can [create a cache rule](/cache/how-to/cache-rules/create-dashboard/) that caches every returned object matching the `/images/*` URI path for seven days:
This setup will route all traffic matching `http*://<YOUR_HOSTNAME>/images/*` (HTTPS and HTTP requests) to your S3 bucket. Make sure to replace `<YOUR_HOSTNAME>` with your actual hostname and adjust the example paths according to your setup.
Copy file name to clipboardExpand all lines: src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,11 @@ To route requests from visitors in the European Union to a Google Cloud Storage
16
16
-**Subdomain-style URL**: For `<BUCKET_NAME>.storage.googleapis.com`, your files should be organized in the root of the bucket. For example, `https://<YOUR_HOSTNAME>/index.html` will map to `https://<BUCKET_NAME>.storage.googleapis.com/index.html`.
17
17
-**URI path-style URL**: If you set the hostname to `storage.googleapis.com`, your bucket must include folders corresponding to the intended URI paths. For example, if you want `https://<YOUR_HOSTNAME>/eu/index.html` to map to a file in your bucket, the file should be placed at `https://storage.googleapis.com/<BUCKET_NAME>/eu/index.html`.
18
18
5._(Optional)_ Use [URL Rewrite Rules](/rules/transform/url-rewrite/) to adjust the URL structure. For example, you can [create a URL rewrite](/rules/transform/url-rewrite/create-dashboard/) that changes `/eu` to `/<BUCKET_NAME>` to match the URI path-style URL structure.
19
-
6. Select **Next** and enter a descriptive name like `Route EU visitors to GCP` in **Cloud Connector name**.
20
-
7. Under **If**, select **Custom filter expression** and enter the following expression:
19
+
6._(Optional)_ Use [Cache Rules](/cache/how-to/cache-rules/) to adjust the caching behavior for objects returned from the bucket. For example, you can [create a cache rule](/cache/how-to/cache-rules/create-dashboard/) that caches every returned object matching the `/eu` URI path for seven days (defined through the **Edge TTL** setting).
20
+
7. Select **Next** and enter a descriptive name like `Route EU visitors to GCP` in **Cloud Connector name**.
21
+
8. Under **If**, select **Custom filter expression** and enter the following expression:
21
22
`(ip.src.is_in_european_union)`<br />
22
23
This expression targets traffic from European Union users.
23
-
8. Select **Deploy** to activate the rule.
24
+
9. Select **Deploy** to activate the rule.
24
25
25
26
This configuration will route traffic from EU visitors to your Google Cloud Storage bucket. Make sure to replace `<YOUR_HOSTNAME>` with your actual hostname and adjust the example paths according to your setup.
Copy file name to clipboardExpand all lines: src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,10 @@ To serve static assets from an Azure Blob Storage container:
15
15
4. Enter the bucket URL. Use the following URL structure:
16
16
-**Subdomain-style URL**: Set the hostname to `<BUCKET_NAME>.blob.core.windows.net`. In this case, your bucket should include a folder named `static-assets`, and files should be placed inside this folder. For example, `https://<YOUR_HOSTNAME>/static-assets/style.css` will map to `https://<BUCKET_NAME>.blob.core.windows.net/static-assets/style.css`.
17
17
5._(Optional)_ Use [URL Rewrite Rules](/rules/transform/url-rewrite/) to adjust the URL structure. For example, you can [create a URL rewrite](/rules/transform/url-rewrite/create-dashboard/) that changes `/static-assets` to `/my-pages-project/static-assets` to match the file structure of your object storage bucket.
18
-
6. Click **Next** and enter a descriptive name like `Serve static assets from Azure` in **Cloud Connector name**.
19
-
7. Under **If**, select **Custom filter expression** and enter the following expression:
18
+
6._(Optional)_ Use [Cache Rules](/cache/how-to/cache-rules/) to adjust the caching behavior for objects returned from the bucket. For example, you can [create a cache rule](/cache/how-to/cache-rules/create-dashboard/) that caches every returned object matching the `/static-assets` URI path for seven days (defined through the **Edge TTL** setting).
19
+
7. Click **Next** and enter a descriptive name like `Serve static assets from Azure` in **Cloud Connector name**.
20
+
8. Under **If**, select **Custom filter expression** and enter the following expression:
This setup ensures that all traffic matching `http*://<YOUR_HOSTNAME>/static-assets/*` (HTTPS and HTTP requests) is served from your Azure Blob Storage container. Make sure to replace `<YOUR_HOSTNAME>` with your actual hostname and adjust the example paths according to your setup.
Cloud Connector will not apply any of the following configurations:
44
+
45
+
-**Cache content served from storage bucket**: To define custom cache behavior — like when to cache returned objects and for [how long](/cache/how-to/cache-rules/settings/#edge-ttl) — you will need to create a [cache rule](/cache/how-to/cache-rules/). For an example rule configuration, refer to [Cache Level (Cache Everything)](/cache/how-to/cache-rules/examples/cache-everything/).
46
+
47
+
-**Create URL rewrites**: To adjust the URL structure from what your website visitors use to obtain a resource and the folder structure being used in the storage bucket, you will need to create a [URL rewrite](/rules/transform/url-rewrite/). For example, you could create a URL rewrite to remove the `/files` prefix from URI paths before routing the request to your object storage bucket. For an example configuration, refer to [Rewrite path for object storage bucket](/rules/transform/examples/rewrite-path-object-storage/).
48
+
49
+
:::
50
+
41
51
## Availability
42
52
43
53
Cloud Connector is available in beta to all customers. The maximum number of rules depends on your Cloudflare plan:
0 commit comments