URL Normalization: Ingress Rules, Path Matching, and Security
How URL normalization works at the edge and in tunnel ingress matching, including RFC 3986, Access JWT rules, and how to test path-based routing.
This page summarizes Cloudflare documentation on URL normalization: making incoming request URLs follow a consistent format so security features, tunnel ingress rules, and path-based routing behave predictably. The same idea appears in two places—on the global network (WAF, Access, Workers) and in cloudflared before ingress matching when Cloudflare Access JWT validation applies.
URL normalization: why the same path can bypass rules
Section titled “URL normalization: why the same path can bypass rules”URL normalization modifies separators, encoded elements, and literal bytes in incoming URLs so they conform to a consistent formatting standard.
URL normalization modifies separators, encoded elements, and literal bytes in incoming URLs so that they conform to a consistent formatting standard.
— Cloudflare, How URL normalization works
Cloudflare provides URL normalization because one resource can be requested in several equivalent forms—for example /hello and /%68ello—and without normalization, security rules and other features might not match every variant.
Cloudflare provides a URL normalization feature to modify the URLs of incoming requests so that they conform to a consistent formatting standard. This is important because the same resource can be requested using different URL formats (for example, /hello and /%68ello refer to the same path), and without normalization, security rules and other features might not match all variations of a URL.
— Cloudflare, URL normalization
A WAF custom rule blocking www.example.com/hello may not block www.example.com/%68ello until normalization is enabled. Cloudflare strongly recommends enabling Normalize incoming URLs in the dashboard to reduce that risk.
For example, a firewall rule with an expression such as http.request.uri.path contains “/login” could be bypassed if the malicious actor has encoded the l character as %6C. In this scenario, and with URL normalization disabled, traffic would not be matched by the firewall rule.
— Cloudflare, Required firewall rule changes to enable URL normalization
Normalization does not perform redirects and does not change the address in the visitor’s browser. When enabled on the network, it affects later Cloudflare features and, optionally, the URL sent to the origin.
Zone URL normalization: dashboard settings and behavior
Section titled “Zone URL normalization: dashboard settings and behavior”On proxied zones, URL normalization is configured under Rules → URL Normalization in the Cloudflare dashboard. URL normalization settings define three main controls:
| Setting | Default | Effect |
|---|---|---|
| Normalization type | RFC-3986 | RFC-3986 applies strict RFC 3986 normalization; Cloudflare adds extra steps (backslashes, merged slashes) then RFC 3986 |
| Normalize incoming URLs | On | Incoming URLs are normalized before WAF, Workers, Access, and similar features |
| Normalize URLs to origin | Off | When on, the origin receives normalized URLs; only available if incoming normalization is on |
Examples of how these settings change URLs on the network and at the origin are in URL normalization examples.
RFC 3986 normalization vs Cloudflare normalization
Section titled “RFC 3986 normalization vs Cloudflare normalization”RFC 3986 normalization percent-decodes unreserved characters, leaves reserved characters as-is, uppercases percent-encoding, and normalizes paths with Remove Dot Segments (per How URL normalization works).
Cloudflare normalization runs in order: backslashes (\) to forward slashes (/), merge successive slashes, then RFC 3986 on the result (How URL normalization works). That difference matters for paths like example.com/hello//../path—RFC-3986 and Cloudflare can yield different normalized paths in the examples table.
URL normalization requires DNS records proxied through Cloudflare and is available on all Cloudflare plans (URL normalization).
Encoded slashes (%2F) at the edge
Section titled “Encoded slashes (%2F) at the edge”RFC 3986 does not automatically decode %2F to / because / is reserved and decoding can change path meaning. If your origin decodes %2F like many servers do, you can align edge behavior with a Transform Rules URL rewrite using url_decode(http.request.uri.path) when the expression matches encoded slashes—see Normalize encoded slashes in URL path.
cloudflared URL normalization: ingress matching and Access
Section titled “cloudflared URL normalization: ingress matching and Access”From cloudflared version 2026.10.0, Cloudflare Tunnel can normalize URLs before matching ingress rules, which improves security when rules require Cloudflare Access validation. The path sent to your origin is unchanged.
Starting from version 2026.10.0, Cloudflare Tunnel can normalize URLs before matching ingress rules. This improves security for tunnels with rules that require Cloudflare Access validation. The URL path sent to your origin stays the same.
— Cloudflare, Cloudflare Tunnel supports URL normalization
Tunnel normalization removes dot segments (. and ..) per RFC 3986, converts backslashes to forward slashes, and merges repeated slashes (Configuration file — How traffic is matched). Configurations without ingress rules that require Access validation are unaffected by this feature’s security rationale, but you should still test path-based routing before defaults change.
Incoming path vs path used for matching vs origin
Section titled “Incoming path vs path used for matching vs origin”When normalization is on and the tunnel has rules requiring Access validation, cloudflared uses a normalized path only to pick the ingress rule; the origin still sees the original path:
| Incoming path | Path used for ingress matching | Path sent to origin |
|---|---|---|
/hello/../path |
/path |
/hello/../path |
/hello//path |
/hello/path |
/hello//path |
/hello\path |
/hello/path |
/hello\path |
Source: Configuration file — How traffic is matched.
This matches general ingress behavior: cloudflared matches request paths to evaluate rules but forwards the full request path without stripping or rewriting it—URL normalization for ingress matching does not change that (Configuration file — Wildcards). For path stripping or rewriting, use URL Rewrite Rules at the edge or a local reverse proxy.
disable-path-normalization: enable normalization before ingress match
Section titled “disable-path-normalization: enable normalization before ingress match”The run flag --disable-path-normalization defaults to true in 2026.10.0 (normalization off). Set it to false to normalize before ingress matching.
| Mechanism | How to enable normalization |
|---|---|
| CLI | cloudflared tunnel --disable-path-normalization=false run <TUNNEL_NAME_OR_UUID> |
| Environment | TUNNEL_DISABLE_PATH_NORMALIZATION=false on each replica, then restart |
See Run parameters — disable-path-normalization and the changelog.
Access-protected hostnames use originRequest.access with JWT validation via the Cf-Access-Jwt-Assertion header; URL normalization before ingress matching is documented under URL normalization in Origin parameters — access.
Ingress rules: structure, path regex, and catch-all
Section titled “Ingress rules: structure, path regex, and catch-all”Ingress rules specify which local services receive proxied traffic. If a rule omits path, all paths match. Rules are evaluated in order; the config must end with a catch-all (for example service: http_status:404) (Configuration file, Ingress rule).
- Hostname can use a leading wildcard (
*.example.com); mid-hostname wildcards such astest.*.example.comare not supported. pathaccepts Go-syntax regular expressions (for example\.(jpg|png|css|js)$onstatic.example.com).
Path-based routing and normalization interact: after normalization is default-on, a request whose encoded or dotted path would have matched a different rule may match another rule first—test with the CLI tools below.
Enable zone normalization without breaking firewall rules
Section titled “Enable zone normalization without breaking firewall rules”Before enabling Normalize incoming URLs, review firewall rules that detect //, ../, or other non-normalized patterns. Either remove obsolete “manual normalization” rules or switch to raw fields: raw.http.request.uri.path, raw.http.request.full_uri, raw.http.request.uri (Required firewall rule changes). Then enable normalization in Rules → Overview → URL Normalization (Firewall or Administrator role required).
Common mistakes
Section titled “Common mistakes”- Assuming the origin sees normalized paths — With tunnel normalization, only ingress matching uses the normalized path; the origin gets the original path unless you also enable Normalize URLs to origin on the zone or rewrite URLs elsewhere.
- Path-based ingress rules without testing after 2027-01-25 — Default-on tunnel normalization can change which rule matches (changelog).
- WAF rules on
http.request.uri.pathonly — Encoded variants can bypass rules until URL normalization is on or expressions use raw fields intentionally. - Expecting cloudflared to strip path prefixes — Use edge URL Rewrite Rules or a local proxy; ingress only forwards the full path (Path forwarding).
- Ignoring normalization type — Cloudflare vs RFC-3986 changes outcomes for backslashes and dot segments (examples).
How to check this on your site
Section titled “How to check this on your site”-
Validate the tunnel config syntax with
cloudflared tunnel ingress validate(Validate ingress rules). -
For a specific URL, run
cloudflared tunnel ingress rule https://your.host.example/pathand confirm the matched rule index, hostname, andservice(Test ingress rules). -
If you use Access on tunnel hostnames, confirm
originRequest.accessand test with--disable-path-normalization=falsebefore the planned default change. -
In the Cloudflare dashboard, review URL Normalization settings and compare behavior to URL normalization examples for encoded paths your WAF rules must catch.
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.