Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
---
title: Custom Rules
title: Custom rules
pcx_content_type: overview
sidebar:
order: 3

---

Cloudflare Rules allows you to make adjustments to requests and responses, configure Cloudflare settings, and trigger specific actions for matching requests. In addition, you can increase your security posture by including security headers to the browser or augmenting request headers with security intelligence. Cloudflare offers many ways to manipulate your traffic:

1. [**Transform Rules**](/rules/transform/) enable the modification of the URI path, query string, and HTTP headers for both requests and responses on its global network. This feature provides extensive control over HTTP traffic, allowing users to rewrite URLs, modify request and response headers, and apply common adjustments easily.

2. [**URL normalization rules**](/rules/normalization/) normalizes all requests before they pass to subsequent global network features that accept a URL input, such as WAF custom rules, Workers, and Access. Rule expressions that filter traffic based on URLs will therefore trigger correctly, regardless of the format of the incoming URL. When URL normalization is disabled, Cloudflare forwards the URL to origin in its original form.

3. [**Redirect rules**](/rules/url-forwarding/) navigates the user from a source URL to a target URL with a specific HTTP status code. This can be done using [single redirects](/rules/url-forwarding/single-redirects/) (per domain) or [bulk redirects](/rules/url-forwarding/bulk-redirects/) (per account).
import { Render } from "~/components";

4. [**Origin rules**](/rules/origin-rules/) allows you to customize where the incoming traffic will go and with which parameters. Currently you can perform the following overrides: host header, Server Name Indication, DNS record, and destination port.
<Render file="custom-rules-intro" product="waf" />

5. [**Configuration rules**](/rules/configuration-rules/) allows you to customize certain Cloudflare configuration settings for matching incoming requests.
The [custom rules documentation](/waf/custom-rules/) includes examples for common use cases.

6. [**Compression rules**](/rules/compression-rules/) allows you to customize the default behavior, which includes defining preferred compression algorithms for particular file types.
## Skip rules

7. [**Snippets**](/rules/snippets/) provides a flexible way to customize the behavior of your website or application using short pieces of JavaScript code. Use snippets to customize HTTP response headers, implement JWT validation, define complex redirect functionality, and more.
You can skip one or more Cloudflare security features using a custom rule [configured with the _Skip_ action](/waf/custom-rules/skip/). These rules are also known as skip rules. Refer to [Skip options](/waf/custom-rules/skip/options/) for more information on the features you can skip.
7 changes: 2 additions & 5 deletions src/content/docs/waf/custom-rules/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ sidebar:
order: 5
---

Custom rules allow you to control incoming traffic by filtering requests to a zone. You can perform actions like _Block_ or _Managed Challenge_ on incoming requests according to rules you define.
import { Render } from "~/components";

Like other rules evaluated by Cloudflare's [Ruleset Engine](/ruleset-engine/), custom rules have the following basic parameters:

- An [expression](/ruleset-engine/rules-language/expressions/) that specifies the criteria you are matching traffic on using the [Rules language](/ruleset-engine/rules-language/).
- An [action](/ruleset-engine/rules-language/actions/) that specifies what to perform when there is a match for the rule.
<Render file="custom-rules-intro" product="waf" />

Custom rules are evaluated in order, and some actions like _Block_ will stop the evaluation of other rules. For more details on actions and their behavior, refer to the [actions reference](/ruleset-engine/rules-language/actions/).

Expand Down
6 changes: 2 additions & 4 deletions src/content/docs/waf/custom-rules/skip/options.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
title: Skip options
title: Available skip options
pcx_content_type: reference
sidebar:
order: 4
head:
- tag: title
content: Available skip options
label: Skip options
---

The available skip options in custom rules are the following:
Expand Down
10 changes: 10 additions & 0 deletions src/content/partials/waf/custom-rules-intro.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
{}
---

Custom rules allow you to control incoming traffic by filtering requests to a zone. You can perform actions like _Block_ or _Managed Challenge_ on incoming requests according to rules you define.

Like other rules evaluated by Cloudflare's [Ruleset Engine](/ruleset-engine/), custom rules have the following basic parameters:

- An [expression](/ruleset-engine/rules-language/expressions/) that specifies the criteria you are matching traffic on using the [Rules language](/ruleset-engine/rules-language/).
- An [action](/ruleset-engine/rules-language/actions/) that specifies what to perform when there is a match for the rule.
Loading