Skip to content

Commit 4dd46e4

Browse files
authored
[Rules] Use Steps component (#24989)
1 parent 7866ee4 commit 4dd46e4

35 files changed

+655
-318
lines changed

src/content/docs/rules/cloud-connector/create-dashboard.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ head:
88
content: Configure a Cloud Connector rule in the dashboard
99
---
1010

11-
import { Render } from "~/components";
11+
import { Render, Steps } from "~/components";
1212

1313
To configure a Cloud Connector rule in the dashboard:
1414

15+
<Steps>
16+
1517
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain.
1618

1719
2. Go to **Rules** > **Cloud Connector**.
@@ -38,3 +40,5 @@ To configure a Cloud Connector rule in the dashboard:
3840
7. To save and deploy your rule, select **Deploy**. If you are not ready to deploy the rule, select **Save as Draft**.
3941

4042
<Render file="rules-creation-dash-dns-popup" product="rules" />
43+
44+
</Steps>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ products:
77
- Cloud Connector
88
---
99

10+
import { Steps } from "~/components";
11+
1012
To route requests to `/images` on your domain to an AWS S3 bucket:
1113

14+
<Steps>
15+
1216
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
1317
2. Go to **Rules** > **Cloud Connector**.
1418
3. Select **Amazon Web Services - S3** as your [cloud provider](/rules/cloud-connector/providers/).
@@ -26,4 +30,6 @@ To route requests to `/images` on your domain to an AWS S3 bucket:
2630
Replace `<YOUR_HOSTNAME>` with desired hostname.
2731
9. Select **Deploy** to activate the rule.
2832

33+
</Steps>
34+
2935
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ products:
77
- Cloud Connector
88
---
99

10+
import { Steps } from "~/components";
11+
1012
To route requests from visitors in the European Union to a Google Cloud Storage bucket:
1113

14+
<Steps>
15+
1216
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
1317
2. Go to **Rules** > **Cloud Connector**.
1418
3. Select **Google Cloud Platform - Cloud Storage** as your [cloud provider](/rules/cloud-connector/providers/).
@@ -23,4 +27,6 @@ To route requests from visitors in the European Union to a Google Cloud Storage
2327
This expression targets traffic from European Union users.
2428
9. Select **Deploy** to activate the rule.
2529

30+
</Steps>
31+
2632
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ products:
77
- Cloud Connector
88
---
99

10+
import { Steps } from "~/components";
11+
1012
To serve static assets from an Azure Blob Storage container:
1113

14+
<Steps>
15+
1216
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
1317
2. Navigate to **Rules** > **Cloud Connector**.
1418
3. Select **Microsoft Azure - Blob Storage** as your [cloud provider](/rules/cloud-connector/providers/).
@@ -21,4 +25,6 @@ To serve static assets from an Azure Blob Storage container:
2125
`http.request.full_uri wildcard "http*://<YOUR_HOSTNAME>/static-assets/*"`<br />
2226
9. Select **Deploy** to activate the rule.
2327

28+
</Steps>
29+
2430
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/providers.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 5
66
---
77

8-
import { Render } from "~/components";
8+
import { Render, Steps } from "~/components";
99

1010
Cloud Connector currently supports the following cloud providers and services:
1111

@@ -43,11 +43,15 @@ The SSL setting applied to requests between Cloud Connector and AWS S3 depends o
4343

4444
### Get the bucket URL
4545

46+
<Steps>
47+
4648
1. Go to the [Amazon S3 console](https://console.aws.amazon.com/s3/) and select **Buckets** in the navigation pane.
4749
2. Select the bucket name.
4850
3. Go to the **Properties** tab.
4951
4. Select the **Static Website Hosting** card. The **Endpoint** field shows your bucket URL.
5052

53+
</Steps>
54+
5155
For more information, refer to the [Amazon S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EnableWebsiteHosting.html).
5256

5357
<Render file="cloud-connector-limit-bucket-to-cloudflare-ips" product="rules" />
@@ -66,6 +70,8 @@ Cloud Connector supports both subdomain and URI path-style URLs:
6670

6771
### Get the bucket URL
6872

73+
<Steps>
74+
6975
1. Go to the [Google Cloud console](https://console.cloud.google.com/storage/browser) and select **Buckets**.
7076
2. Select the bucket name.
7177
3. For one of the files already in the bucket, select the link icon in the **Public** column to copy the file's public URL to the clipboard. The file URL will have the following format:
@@ -75,6 +81,8 @@ Cloud Connector supports both subdomain and URI path-style URLs:
7581
To obtain the subdomain bucket URL, refactor the file URL to `<BUCKET_NAME>.storage.googleapis.com` format.<br/>
7682
To obtain the URI path bucket URL, remove `https://` and `/<BUCKET_NAME>/<OBJECT_NAME>` from the file URL.
7783

84+
</Steps>
85+
7886
If the files in your bucket are not publicly accessible, you must change the bucket permissions. For details, refer to the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/access-control/making-data-public#buckets).
7987

8088
<Render file="cloud-connector-limit-bucket-to-cloudflare-ips" product="rules" />
@@ -90,10 +98,14 @@ For Azure Blog Storage, Cloud Connector supports only subdomain URLs like `<BUCK
9098

9199
### Get the bucket URL
92100

101+
<Steps>
102+
93103
1. Go to the [Azure portal](https://portal.azure.com/) and select your storage account.
94104
2. In the menu pane, under **Settings**, select **Endpoints**.
95105
3. Get your bucket URL from the **Blob service** endpoint or the **Static website** endpoint.
96106

107+
</Steps>
108+
97109
If the blob container is not configured for public access, you must change the container settings. For details, refer to the [Azure Storage documentation](https://learn.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-configure?tabs=portal).
98110

99111
<Render file="cloud-connector-limit-bucket-to-cloudflare-ips" product="rules" />

src/content/docs/rules/compression-rules/create-dashboard.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ sidebar:
66
label: Create a rule in the dashboard
77
---
88

9-
import { Render } from "~/components";
9+
import { Render, Steps } from "~/components";
10+
11+
<Steps>
1012

1113
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain.
1214
2. Go to **Rules** > **Overview**.
@@ -19,3 +21,5 @@ import { Render } from "~/components";
1921
9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
2022

2123
<Render file="rules-creation-dash-dns-popup" product="rules" />
24+
25+
</Steps>

src/content/docs/rules/configuration-rules/create-dashboard.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ sidebar:
66
label: Create a rule in the dashboard
77
---
88

9-
import { Render } from "~/components";
9+
import { Render, Steps } from "~/components";
10+
11+
<Steps>
1012

1113
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain.
1214
2. Go to **Rules** > **Overview**.
@@ -19,3 +21,5 @@ import { Render } from "~/components";
1921
9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
2022

2123
<Render file="rules-creation-dash-dns-popup" product="rules" />
24+
25+
</Steps>

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ sidebar:
55
order: 3
66
---
77

8-
import { APIRequest, Render } from "~/components";
8+
import { APIRequest, Render, Steps } from "~/components";
99

1010
## In the dashboard
1111

1212
### Create a custom error rule {/* create-a-custom-error-rule-dashboard */}
1313

14+
<Steps>
15+
1416
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website.
1517
2. Go to **Rules** > **Overview**.
1618
3. Select **Create rule** > **Custom Error Rule**.
@@ -33,22 +35,32 @@ import { APIRequest, Render } from "~/components";
3335

3436
9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
3537

38+
</Steps>
39+
3640
### Create a custom error asset {/* create-a-custom-error-asset-dashboard */}
3741

42+
<Steps>
43+
3844
1. In the **Create Custom Error Asset** sidebar, enter a name for the asset in **Asset name**.
3945
2. (Optional) Enter a description for the asset in **Description**.
4046
3. In **URL**, enter the URL of the page you want to fetch and store in Cloudflare's global network. Cloudflare will fetch all the page resources and store a minified version of the page you can use in one or more custom error rules.
4147
4. Select **Save**.
4248

49+
</Steps>
50+
4351
To review existing custom error assets, go to **Rules** > **Settings** > **Custom Error Assets** tab.
4452

4553
## Via API
4654

4755
To configure a custom error rule via API:
4856

57+
<Steps>
58+
4959
1. (Optional) [Create a custom error asset](#create-a-custom-error-asset-api) based on a URL you provide.
5060
2. [Create a custom error rule](#create-a-custom-error-rule-api) in the `http_custom_errors` phase, using the [Rulesets API](/ruleset-engine/rulesets-api/).
5161

62+
</Steps>
63+
5264
### Create a custom error asset {/* create-a-custom-error-asset-api */}
5365

5466
The following `POST` request creates new a custom error asset in a zone based on the provided URL:
@@ -86,18 +98,22 @@ When creating a custom error rule via API, make sure you:
8698

8799
The first rule in the `http_custom_errors` phase ruleset that matches will be applied. No other rules in the ruleset will be matched or applied. Additionally, custom error rules defined at the zone level will have priority over rules defined at the account level.
88100

89-
### General procedure
101+
#### General procedure
90102

91103
Follow this workflow to create a custom error rule for a given zone via API:
92104

105+
<Steps>
106+
93107
1. Use the [List zone rulesets](/api/resources/rulesets/methods/list/) operation to check if there is already a ruleset for the `http_custom_errors` phase at the zone level.
94108
2. If the phase ruleset does not exist, create it using the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation, which allows you to create a ruleset if it does not exist and update all the rules in the ruleset. Create the ruleset in the `http_custom_errors` phase.
95109

96110
If the phase ruleset already exists, use the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation to replace all the rules in the ruleset, or the [Add rule to ruleset](/ruleset-engine/rulesets-api/add-rule/) operation to add a rule to the existing rules in the ruleset.
97111

112+
</Steps>
113+
98114
To create a custom error rule at the account level, use the corresponding account-level API endpoints.
99115

100-
### Example
116+
#### Example
101117

102118
This example configures a custom error rule returning a [previously created custom error asset](#create-a-custom-error-asset-api) named `500_error_template` for responses with a `500` HTTP status code.
103119

@@ -131,7 +147,7 @@ This example configures a custom error rule returning a [previously created cust
131147

132148
This `PUT` request, corresponding to the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation, replaces any existing rules in the `http_custom_errors` phase entry point ruleset.
133149

134-
## Required API token permissions
150+
### Required API token permissions
135151

136152
The API token used in API requests to manage Custom Error Rules and Custom Error Assets must have at least the following permission:
137153

src/content/docs/rules/custom-errors/edit-error-pages.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Details, DashButton } from "~/components";
8+
import { Details, DashButton, Steps } from "~/components";
99

1010
## Before you start
1111

@@ -61,6 +61,8 @@ The following HTML code is an example error page for 5XX errors without styling:
6161

6262
To update an account-level custom error page:
6363

64+
<Steps>
65+
6466
1. In the Cloudflare dashboard, go to the **Settings** page.
6567

6668
<DashButton url="/?to=/:account/configurations" />
@@ -71,17 +73,23 @@ To update an account-level custom error page:
7173
5. To use Cloudflare's default page, select **Cloudflare default page.** To provide a custom error page, select **Custom page** and enter the URL of the custom error page you created.
7274
6. Select **Confirm**.
7375

76+
</Steps>
77+
7478
### Zone-level custom error page
7579

7680
To edit a zone-level custom error page:
7781

82+
<Steps>
83+
7884
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website.
7985
2. Go to **Error Pages** and identify your desired custom error page type.
8086
3. (Optional) To preview the current error page (default or custom), select the link in the **Show** column.
8187
4. To edit the error page, select the three dots > **Edit** next to the page type you previously identified.
8288
5. To use Cloudflare's default page, select **Cloudflare default page.** To provide a custom error page, select **Custom page** and enter the URL of the custom error page you created.
8389
6. Select **Confirm**.
8490

91+
</Steps>
92+
8593
### Fetch custom error page again
8694

8795
After successfully setting the content of the custom error page in **Error Pages**, you can remove the page from your origin server.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ head:
88
content: Custom Errors
99
---
1010

11-
import { FeatureTable, Render } from "~/components";
11+
import { FeatureTable, Render, Steps } from "~/components";
1212

1313
Use Custom Errors to return custom content to your website visitors in case of HTTP errors returned by an origin server or by a Cloudflare product (including Workers), or when showing a [security challenge](/cloudflare-challenges/).
1414

@@ -25,13 +25,17 @@ Cloudflare has a set of default pages for presenting errors and challenges to yo
2525

2626
When an error of a [specific type](/rules/custom-errors/reference/error-page-types/) occurs, Cloudflare does the following:
2727

28+
<Steps>
29+
2830
1. Search for a configured Error Page at the account level for the specific error.
2931
2. Search for a configured Error Page at the zone level for the specific error (it will have priority over the account-level Error Page, if any).
3032
3. Search for a matching custom error rule at the account level. The rule will have priority over 500 and 1000 class Error Pages at the account or zone level.
3133
4. Search for a matching custom error rule at the zone level. The rule will have priority over 500 and 1000 class Error Pages at the account or zone level and over custom error rules at the account level.
3234
5. If a security rule like a [WAF custom rule](/waf/custom-rules/) or a [rate limiting rule](/waf/rate-limiting-rules/) triggers a custom block response instead of a default Cloudflare WAF block page, the rule-specific block response will have priority over Error Pages or a matching custom error rule.
3335
6. If any of the previous configurations apply, serve the custom error content to the visitor. If not, serve the default error page for the specific error type.
3436

37+
</Steps>
38+
3539
:::note
3640
To customize a challenge page or a block page, use an Error Page, since Custom Error Rules will not be applied to security actions originating from Cloudflare products. Keep in mind that [custom WAF response](/waf/custom-rules/create-dashboard/#configure-a-custom-response-for-blocked-requests) takes precedence over an Error Page and custom error rules.
3741
:::

0 commit comments

Comments
 (0)