Skip to content

Commit 7812af1

Browse files
committed
path regex
1 parent d6fd123 commit 7812af1

File tree

1 file changed

+7
-9
lines changed
  • src/content/docs/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management

1 file changed

+7
-9
lines changed

src/content/docs/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/configuration-file.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@ Configuration files that contain ingress rules must always include a catch-all r
4848

4949
### How traffic is matched
5050

51-
When `cloudflared` receives an incoming request, it evaluates each ingress rule from top to bottom to find which rule matches the request. Rules can match either the hostname or path of an incoming request, or both.
52-
53-
:::note[Wildcards]
54-
55-
You can use wildcards to match traffic to multiple subdomains or paths. For example, if you set the `hostname` key to `*.example.com`, both `test.example.com` and `try.example.com` will route traffic to your origin.
56-
57-
:::
58-
59-
If a rule does not specify a hostname, all hostnames will be matched. If a rule does not specify a path, all paths will be matched.
51+
When `cloudflared` receives an incoming request, it evaluates each ingress rule from top to bottom to find which rule matches the request. Rules can match either the hostname or path of an incoming request, or both. If a rule does not specify a hostname, all hostnames will be matched. If a rule does not specify a path, all paths will be matched.
6052

6153
The last ingress rule must be a catch-all rule that matches all traffic.
6254

@@ -81,6 +73,12 @@ ingress:
8173
- service: https://localhost:8003
8274
```
8375

76+
#### Wildcards
77+
78+
You can use wildcards to match traffic to multiple subdomains. For example, if you set the `hostname` key to `*.example.com`, both `alpha.example.com` and `beta.example.com` will route traffic to your origin. `cloudflared` does not support wildcards in the middle of the hostname, such as `test.*.example.com`.
79+
80+
You can also enter regular expressions for the `path` key. For example, if `hostname` is `static.example.com` and `path` is `\.(jpg|png|css|js)$`, matching URLs could include `https://static.example.com/data.js`, `http://static.example.com/images/photo.jpg`, and so on. Cloudflare parses the path regex using the [Go `syntax` package](https://pkg.go.dev/regexp/syntax).
81+
8482
### Supported protocols
8583

8684
In addition to HTTP, `cloudflared` supports protocols like SSH, RDP, arbitrary TCP services, and Unix sockets. You can also route traffic to the built-in `Hello World` test server or respond to traffic with an HTTP status.

0 commit comments

Comments
 (0)