You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: products/workers/src/content/runtime-apis/headers.md
+32-11Lines changed: 32 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -37,24 +37,45 @@ Cloudflare sets a number of [its own custom headers on incoming requests](https:
37
37
38
38
### Request headers
39
39
40
-
*`CF-Connecting-IP`: In same-zone Worker subrequests, the value of `CF-Connecting-IP` reflects the value of `x-real-ip` (the client’s IP). `x-real-ip` can be altered by the user in their Worker script.
40
+
<details>
41
+
<summary>CF-Connecting-IP</summary>
42
+
<div>
41
43
42
-
In cross-zone subrequests from one Cloudflare customer zone to another Cloudflare customer zone, the `CF-Connecting-IP`value will be set to the Worker client IP address `'2a06:98c0:3600::103'` for security reasons.
44
+
In same-zone Worker subrequests, the value of `CF-Connecting-IP`reflects the value of `x-real-ip` (the client’s IP). `x-real-ip` can be altered by the user in their Worker script.
43
45
44
-
For Worker subrequests destined for a non-Cloudflare customer zone, the `CF-Connecting-IP`and `x-real-ip` headers will both reflect the client's IP address, with only the `x-real-ip` header able to be altered.
46
+
In cross-zone subrequests from one Cloudflare customer zone to another Cloudflare customer zone, the `CF-Connecting-IP`value will be set to the Worker client IP address`'2a06:98c0:3600::103'` for security reasons.
45
47
46
-
When no Worker subrequest is triggered, `cf-connecting-ip`reflects the client's IP address and the `x-real-ip` header is stripped.
48
+
For Worker subrequests destined for a non-Cloudflare customer zone, the `CF-Connecting-IP` and `x-real-ip`headers will both reflect the client's IP address, with only the `x-real-ip` header able to be altered.
47
49
48
-
*`CF-Worker`: Added to all Worker subrequests sent via `fetch()`. Set to the name of the zone which owns the Worker making the subrequest. For example, a Worker script on route for `foo.example.com/*` from `example.com` will have all subrequests with the header:
50
+
When no Worker subrequest is triggered, `cf-connecting-ip` reflects the client's IP address and the `x-real-ip` header is stripped.
49
51
50
-
`CF-Worker`: `example.com`
52
+
</div>
53
+
</details>
51
54
52
-
The intended purpose of this header is to provide a means for recipients (for example, origins, load balancers, other Workers) to recognize, filter, and route traffic generated by Workers on specific zones.
55
+
<details>
56
+
<summary>CF-Worker</summary>
57
+
<div>
53
58
54
-
<Asidetype="note">
59
+
Added to all Worker subrequests sent via `fetch()`. Set to the name of the zone which owns the Worker making the subrequest. For example, a Worker script on route for `foo.example.com/*` from `example.com` will have all subrequests with the header:
55
60
56
-
When configuring Cloudflare Firewall Rules, do not match on this header. Firewall Rules are applied before Cloudflare adds the `CF-Worker` header. Instead, use the `cf.worker.upstream_zone`(https://tinyurl.com/2wx4senh) dynamic field, which contains the same value and exists for the same purpose.
61
+
`CF-Worker`: `example.com`
57
62
58
-
</Aside>
63
+
The intended purpose of this header is to provide a means for recipients (for example, origins, load balancers, other Workers) to recognize, filter, and route traffic generated by Workers on specific zones.
59
64
60
-
*`CF-EW-Via`: Used for loop detection, similar to the `CDN-Loop`[header](https://blog.cloudflare.com/preventing-request-loops-using-cdn-loop/).
65
+
<Asidetype="note">
66
+
67
+
When configuring Cloudflare Firewall Rules, do not match on this header. Firewall Rules are applied before Cloudflare adds the `CF-Worker` header. Instead, use the `cf.worker.upstream_zone`(https://tinyurl.com/2wx4senh) dynamic field, which contains the same value and exists for the same purpose.
68
+
69
+
</Aside>
70
+
71
+
</div>
72
+
</details>
73
+
74
+
<details>
75
+
<summary>CF-EW-Via</summary>
76
+
<div>
77
+
78
+
Used for loop detection, similar to the `CDN-Loop`[header](https://blog.cloudflare.com/preventing-request-loops-using-cdn-loop/).
0 commit comments