Skip to content

Commit 878efcd

Browse files
committed
[Rules] Update Transform Rules
1 parent 77ed57d commit 878efcd

File tree

60 files changed

+307
-347
lines changed

Some content is hidden

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

60 files changed

+307
-347
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/reference/page-rules-migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ becomes a **filter expression** such as:
6262

6363
</Example>
6464

65-
[Single Redirects](/rules/url-forwarding/single-redirects/create-dashboard/) and [Rewrite URL](/rules/transform/url-rewrite/create-dashboard/) rules also offer a simplified view called **Wildcard pattern**, allowing you to specify URL patterns (`http*://example.com/*/downloads/*.txt*`) without specifying the full filter expression (`http.request.full_uri wildcard "http*://example.com/*/downloads/*.txt*"`).
65+
[Single Redirects](/rules/url-forwarding/single-redirects/create-dashboard/) and [URL Rewrite Rules](/rules/transform/url-rewrite/create-dashboard/) also offer a simplified view called **Wildcard pattern**, allowing you to specify URL patterns (`http*://example.com/*/downloads/*.txt*`) without specifying the full filter expression (`http.request.full_uri wildcard "http*://example.com/*/downloads/*.txt*"`).
6666

6767
### Important considerations
6868

src/content/docs/rules/transform/examples/add-request-header-bot-score.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
---
22
pcx_content_type: example
3-
summary: Create a request header modification rule (part of Transform Rules) to
4-
add a `X-Bot-Score` HTTP header to the request with the current bot score.
3+
summary: Create a request header transform rule to add a `X-Bot-Score` HTTP header to the request with the current bot score.
54
products:
65
- Transform Rules
76
operation:
87
- Request modification
98
title: Add a request header with the current bot score
10-
description: Create a request header modification rule (part of Transform Rules)
11-
to add a `X-Bot-Score` HTTP header to the request with the current bot score.
9+
description: Create a request header transform rule to add a `X-Bot-Score` HTTP header to the request with the current bot score.
1210
---
1311

1412
import { Example } from "~/components";
1513

16-
The following HTTP request header modification rule adds a header named `X-Bot-Score` with the current bot score to the request:
14+
The following request header transform rule adds a header named `X-Bot-Score` with the current bot score to the HTTP request:
1715

1816
<Example>
1917

0 commit comments

Comments
 (0)