Skip to content

Commit 112bbb3

Browse files
committed
Added troubleshooting entry in Rules
1 parent 41917d0 commit 112bbb3

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/content/docs/rules/reference/troubleshooting.mdx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ head:
77
- tag: title
88
content: Rules troubleshooting
99
description: Review common troubleshooting scenarios for Rules features.
10-
1110
---
1211

13-
import { Example, Render } from "~/components"
12+
import { Example, Render } from "~/components";
1413

1514
## Interaction between Cloudflare challenges and Rules features
1615

@@ -28,6 +27,12 @@ For example, define a compound expression for your rule using the `and` operator
2827

2928
If you are using [HTTP DCV](/ssl/edge-certificates/changing-dcv-method/methods/http/) and also have [Single Redirects](/rules/url-forwarding/single-redirects/) set up in your zone, consider excluding the `/.well-known/*` path from your rule to avoid DCV issues. For details and other resources refer to the [SSL/TLS documentation](/ssl/edge-certificates/changing-dcv-method/).
3029

30+
## Content-Length header removed from response
31+
32+
Cloudflare may remove the `Content-Length` header from responses delivered to website visitors. If the visitor must receive the `Content-Length` header, configure the origin server to include a `cache-control: no-transform` HTTP header in the response.
33+
34+
Alternatively, disable compression using a [compression rule](/rules/compression-rules/) and ensure that no Cloudflare settings are changing the response received from the origin server. For details on which products can change the response content, refer to [Notes about end-to-end compression](/speed/optimization/content/compression/#notes-about-end-to-end-compression).
35+
3136
## URL rewrites affect other Rules features executed later
3237

3338
If you rewrite a URI path using a [URL rewrite](/rules/transform/url-rewrite/), this may affect other Rules features executed later — such as [Origin Rules](/rules/origin-rules/) — if they include the URI path in their filter expression.
@@ -36,17 +41,17 @@ Consider the following origin rule configuration:
3641

3742
<Example>
3843

39-
* Rule expression: `http.host == "example.com" and starts_with(http.request.uri.path, "/downloads/")`
40-
* **Host header** > **Rewrite to**: `assets.example.com`
44+
- Rule expression: `http.host == "example.com" and starts_with(http.request.uri.path, "/downloads/")`
45+
- **Host header** > **Rewrite to**: `assets.example.com`
4146

4247
</Example>
4348

4449
If you configure a new URL rewrite with the following configuration:
4550

4651
<Example>
4752

48-
* Rule expression: `http.host == "example.com" and starts_with(http.request.uri.path, "/downloads/")`
49-
* **Path** > **Rewrite to** > **Dynamic**: `regex_replace(http.request.uri.path, "^/downloads/", "/")`
53+
- Rule expression: `http.host == "example.com" and starts_with(http.request.uri.path, "/downloads/")`
54+
- **Path** > **Rewrite to** > **Dynamic**: `regex_replace(http.request.uri.path, "^/downloads/", "/")`
5055

5156
</Example>
5257

@@ -62,17 +67,17 @@ In the current example, you could use the `raw.http.request.uri.path` field in b
6267

6368
<Example>
6469

65-
* Rule expression: `http.host == "example.com" and starts_with(raw.http.request.uri.path, "/downloads/")`
66-
* **Path** > **Rewrite to** > **Dynamic**: `regex_replace(raw.http.request.uri.path, "^/downloads/", "/")`
70+
- Rule expression: `http.host == "example.com" and starts_with(raw.http.request.uri.path, "/downloads/")`
71+
- **Path** > **Rewrite to** > **Dynamic**: `regex_replace(raw.http.request.uri.path, "^/downloads/", "/")`
6772

6873
</Example>
6974

7075
**Origin rule**
7176

7277
<Example>
7378

74-
* Rule expression: `http.host == "example.com" and starts_with(raw.http.request.uri.path, "/downloads/")`
75-
* **Host header** > **Rewrite to**: `assets.example.com`
79+
- Rule expression: `http.host == "example.com" and starts_with(raw.http.request.uri.path, "/downloads/")`
80+
- **Host header** > **Rewrite to**: `assets.example.com`
7681

7782
</Example>
7883

0 commit comments

Comments
 (0)