diff --git a/docs/tutorials/reverse-proxy.md b/docs/tutorials/reverse-proxy.md index b1a5daa..d306ea3 100644 --- a/docs/tutorials/reverse-proxy.md +++ b/docs/tutorials/reverse-proxy.md @@ -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`) +``` + #### 规则 目前支持的匹配规则列表 diff --git a/en/docs/tutorials/reverse-proxy.md b/en/docs/tutorials/reverse-proxy.md index 4320ca6..66e27d3 100644 --- a/en/docs/tutorials/reverse-proxy.md +++ b/en/docs/tutorials/reverse-proxy.md @@ -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