Skip to content

Commit e7fbdf3

Browse files
pedrosousaOxyjun
andauthored
[Rules] Cloud Connector: Mention configs which are not applied (#22660)
--------- Co-authored-by: Jun Lee <[email protected]>
1 parent e578a9f commit e7fbdf3

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ To route requests to `/images` on your domain to an AWS S3 bucket:
1616
- **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`.
1717
- **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`.
1818
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:
20+
- **If incoming requests match** > Custom filter expression: `(starts_with(http.request.uri.path, "/images/"))`
21+
- **Cache eligibility**: Eligible for cache
22+
- **Edge TTL** > Ignore cache-control header and use this TTL: _7 days_
23+
7. Select **Next** and enter a descriptive name like `Route images to S3` in **Cloud Connector name**.
24+
8. Under **If**, select **Custom filter expression** and enter the following expression:<br />
2125
`http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/images/*"`<br />
2226
Replace `<YOUR_HOSTNAME>` with desired hostname.
23-
8. Select **Deploy** to activate the rule.
27+
9. Select **Deploy** to activate the rule.
2428

2529
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.

src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ To route requests from visitors in the European Union to a Google Cloud Storage
1616
- **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`.
1717
- **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`.
1818
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:
2122
`(ip.src.is_in_european_union)`<br />
2223
This expression targets traffic from European Union users.
23-
8. Select **Deploy** to activate the rule.
24+
9. Select **Deploy** to activate the rule.
2425

2526
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.

src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ To serve static assets from an Azure Blob Storage container:
1515
4. Enter the bucket URL. Use the following URL structure:
1616
- **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`.
1717
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:
2021
`http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/static-assets/*"`<br />
21-
8. Select **Deploy** to activate the rule.
22+
9. Select **Deploy** to activate the rule.
2223

2324
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.

src/content/docs/rules/cloud-connector/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ Cloud Connector will perform the following configurations automatically, dependi
3838
- Modify the `Host` header.
3939
- Adjust SSL/TLS for bucket-related traffic ([AWS S3 website endpoints](/rules/cloud-connector/providers/#ssl-connections-to-aws-s3-endpoints) only).
4040

41+
:::note[Additional configurations you may need]
42+
43+
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+
4151
## Availability
4252

4353
Cloud Connector is available in beta to all customers. The maximum number of rules depends on your Cloudflare plan:

0 commit comments

Comments
 (0)