Skip to content

Commit 579e5de

Browse files
authored
[Rules] Update Transform Rules (#21676)
1 parent b876bf1 commit 579e5de

File tree

62 files changed

+314
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+314
-356
lines changed

src/content/docs/fundamentals/reference/policies-compliances/content-security-policies.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ Cloudflare does not:
2828

2929
If you require the CSP headers to be changed or added, you can change them using some Cloudflare products:
3030

31-
- If your website is [proxied](/dns/proxy-status/) through Cloudflare, you can use a [Response Header Modification rule](/rules/transform/response-header-modification/) to replace or add CSP headers.
31+
- If your website is [proxied](/dns/proxy-status/) through Cloudflare, you can use a [response header transform rule](/rules/transform/response-header-modification/) to replace or add CSP headers.
3232
- If your website is hosted using [Cloudflare Pages](/pages/), you can set a [`_headers file`](/pages/configuration/headers/) to modify or add CSP headers.
3333

3434
### Product requirements
3535

3636
To use certain Cloudflare features, however, you may need to update the headers in your CSP:
3737

38-
| Feature(s) | Updated headers |
39-
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
40-
| [Rocket Loader](/speed/optimization/content/rocket-loader/), [Mirage](/speed/optimization/images/mirage/) | `script-src 'self' ajax.cloudflare.com;` |
41-
| [Cloudflare Apps](https://cloudflareapps.com/apps/developer/docs/getting-started), [Scrape Shield](/waf/tools/scrape-shield/) | `script-src 'self' 'unsafe-inline'` |
42-
| [Web Analytics](/web-analytics/) | `script-src static.cloudflareinsights.com; connect-src cloudflareinsights.com` |
38+
| Feature(s) | Updated headers |
39+
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
40+
| [Rocket Loader](/speed/optimization/content/rocket-loader/), [Mirage](/speed/optimization/images/mirage/) | `script-src 'self' ajax.cloudflare.com;` |
41+
| [Cloudflare Apps](https://cloudflareapps.com/apps/developer/docs/getting-started), [Scrape Shield](/waf/tools/scrape-shield/) | `script-src 'self' 'unsafe-inline'` |
42+
| [Web Analytics](/web-analytics/) | `script-src static.cloudflareinsights.com; connect-src cloudflareinsights.com` |
4343
| [Bot products](/bots/) | Refer to [JavaScript detections and CSPs](/bots/additional-configurations/javascript-detections/#if-you-have-a-content-security-policy-csp). |
44-
| [Page Shield](/page-shield/) | Refer to [Page Shield CSP Header format](/page-shield/reference/csp-header/). |
45-
| [Zaraz](/zaraz/) | No updates required ([details](https://blog.cloudflare.com/cloudflare-zaraz-supports-csp/)). |
46-
| [Turnstile](/turnstile/) | Refer to [Turnstile CSP](/turnstile/reference/content-security-policy/). |
44+
| [Page Shield](/page-shield/) | Refer to [Page Shield CSP Header format](/page-shield/reference/csp-header/). |
45+
| [Zaraz](/zaraz/) | No updates required ([details](https://blog.cloudflare.com/cloudflare-zaraz-supports-csp/)). |
46+
| [Turnstile](/turnstile/) | Refer to [Turnstile CSP](/turnstile/reference/content-security-policy/). |

src/content/docs/reference-architecture/diagrams/content-delivery/optimizing-image-delivery-with-cloudflare-image-resizing-and-r2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ https://www.mywebsite.com/cdn-cgi/image/width=80,quality=75/uploads/image.jpg
5050

5151
- [Image Resizing Documentation](/images/transform-images/)
5252
- [Cloudflare R2 Developer Docs](/r2/)
53-
- [Rewrite URL rules](/rules/transform/url-rewrite/)
53+
- [URL Rewrite Rules](/rules/transform/url-rewrite/)
5454
- [Serverless image content management platform](/reference-architecture/diagrams/serverless/serverless-image-content-management/)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To route requests to `/images` on your domain to an AWS S3 bucket:
1515
4. Enter the bucket URL. You can structure the URL in two ways:
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`.
18-
5. _(Optional)_ Use the [Rewrite URL](/rules/transform/url-rewrite/) feature of [Transform Rules](/rules/transform/) 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.
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.
1919
6. Select **Next** and enter a descriptive name like `Route images to S3` in **Cloud Connector name**.
2020
7. Under **If**, select **Custom filter expression** and enter the following expression:<br />
2121
`http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/images/*"`<br />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To route requests from visitors in the European Union to a Google Cloud Storage
1515
4. Enter the bucket URL. You can structure the URL in two ways:
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`.
18-
5. _(Optional)_ Use the [Rewrite URL](/rules/transform/url-rewrite/) feature of [Transform Rules](/rules/transform/) 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.
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.
1919
6. Select **Next** and enter a descriptive name like `Route EU visitors to GCP` in **Cloud Connector name**.
2020
7. Under **If**, select **Custom filter expression** and enter the following expression:
2121
`(ip.src.is_in_european_union)`<br />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To serve static assets from an Azure Blob Storage container:
1414
3. Select **Microsoft Azure - Blob Storage** as your [cloud provider](/rules/cloud-connector/providers/).
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`.
17-
5. _(Optional)_ Use the [Rewrite URL](/rules/transform/url-rewrite/) feature of [Transform Rules](/rules/transform/) 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.
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.
1818
6. Click **Next** and enter a descriptive name like `Serve static assets from Azure` in **Cloud Connector name**.
1919
7. Under **If**, select **Custom filter expression** and enter the following expression:
2020
`http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/static-assets/*"`<br />

src/content/docs/rules/compression-rules/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ The following fields are commonly used in expressions of compression rules:
5555

5656
<Render
5757
file="troubleshoot-rules-with-trace"
58-
params={{ rulesFeatureName: "compression rules" }}
58+
params={{ rulesFeatureName: "Compression Rules" }}
5959
/>

src/content/docs/rules/configuration-rules/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ The number of available configuration rules varies according to your Cloudflare
3737

3838
<Render
3939
file="troubleshoot-rules-with-trace"
40-
params={{ rulesFeatureName: "configuration rules" }}
40+
params={{ rulesFeatureName: "Configuration Rules" }}
4141
/>

src/content/docs/rules/custom-errors/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ When a custom error rule is triggered, Cloudflare will replace the body with the
3131

3232
Cloudflare will keep any existing HTTP response headers except for `Content-Type` and `Content-Length`.
3333

34-
Additionally, you can configure [HTTP response header modification rules](/rules/transform/response-header-modification/) for error responses to add, change, or remove HTTP headers from the response.
34+
Additionally, you can configure [Response Header Transform Rules](/rules/transform/response-header-modification/) for error responses to add, change, or remove HTTP headers from the response.
3535

3636
## Availability
3737

src/content/docs/rules/origin-rules/tutorials/point-to-pages-with-custom-domain.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Use a URL rewrite to remove the `/blog` segment from the URL path.
8080

8181
6. In **Then rewrite the path and/or query**, enter the following values under **Path**:
8282

83-
| Target path | Rewrite to |
84-
| ----------- | ---------- |
85-
| `blog/*` | `${1}` |
83+
| Target path | Rewrite to |
84+
| -------------- | ------------ |
85+
| [`/`] `blog/*` | [`/`] `${1}` |
8686

8787
7. Select **Deploy**.
8888

src/content/docs/rules/origin-rules/tutorials/point-to-r2-bucket-with-custom-domain.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ Use a URL rewrite to remove the `/images` segment from the URL path. Cloudflare
8383

8484
6. In **Then rewrite the path and/or query**, enter the following values under **Path**:
8585

86-
| Target path | Rewrite to |
87-
| ----------- | ---------- |
88-
| `images/*` | `${1}` |
86+
| Target path | Rewrite to |
87+
| ---------------- | ------------ |
88+
| [`/`] `images/*` | [`/`] `${1}` |
8989

9090
7. Select **Deploy**.
9191

0 commit comments

Comments
 (0)