Skip to content

Commit

Permalink
update tutorials/reverse-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Nov 15, 2024
1 parent e068903 commit 8693ec3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/tutorials/reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,30 @@ services:

除了简单的条件过滤外,请求路由同时也集成了Traefik中强大和灵活的[基于规则路由](https://doc.traefik.io/traefik/routing/routers/)功能。

通过`matcher.rule`选项设置节点的匹配规则,当设置了规则后,`filter`将会被忽略。

```yaml hl_lines="15 19"
services:
- name: http
addr: :80
handler:
type: tcp
metadata:
sniffing: true
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:80
matcher:
rule: Host(`www.example.com`) || Host(`www.example.org`)
- name: target-1
addr: 192.168.1.2:80
matcher:
rule: Host(`*.example.com`)
```
#### 规则
目前支持的匹配规则列表
Expand Down
24 changes: 24 additions & 0 deletions en/docs/tutorials/reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,30 @@ services:

In addition to simple conditional filtering, request routing also integrates the powerful and flexible [rule-based routing](https://doc.traefik.io/traefik/routing/routers/) function in Traefik.

The matching rule of the node can be set by the `matcher.rule` option. When the rule is set, `filter` will be ignored.

```yaml hl_lines="15 19"
services:
- name: http
addr: :80
handler:
type: tcp
metadata:
sniffing: true
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:80
matcher:
rule: Host(`www.example.com`) || Host(`www.example.org`)
- name: target-1
addr: 192.168.1.2:80
matcher:
rule: Host(`*.example.com`)
```
#### Rule
Currently supported rules are
Expand Down

0 comments on commit 8693ec3

Please sign in to comment.