Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

反向代理规则匹配ClientIP不起作用 #625

Closed
zyipk opened this issue Dec 17, 2024 · 0 comments
Closed

反向代理规则匹配ClientIP不起作用 #625

zyipk opened this issue Dec 17, 2024 · 0 comments

Comments

@zyipk
Copy link

zyipk commented Dec 17, 2024

配置如下,主机10.0.0.1通过域名访问qwe.example.com时,
流量会划分到7上,规则rule: Host(`*.example.com`) && Proto(`tls`),
而不会划分到1上,规则rule: HostRegexp(`^qwe.example.com$`) && ClientIP(`10.0.0.0/16`)

services:
  - name: 反向代理
    addr: :443
    handler:
      type: tcp
      metadata:
        sniffing: true
    listener:
      type: tcp
    forwarder:
      nodes:
        - name: 1
          addr: 10.0.1.1:443
          matcher:
            rule: HostRegexp(`^qwe\.example\.com$`) && ClientIP(`10.0.0.0/16`)
            priority: 100
        - name: 2
          addr: 10.0.1.2:443
          matcher:
            rule: HostRegexp(`^asd\.example\.com$`) && Proto(`tls`)
            priority: 100
        - name: 3
          addr: 10.0.1.3:443
          matcher:
            rule: HostRegexp(`^zxc\.example\.com$`) && Proto(`tls`)
            priority: 100
        - name: 4
          addr: 10.0.1.4:443
          matcher:
            rule: HostRegexp(`^rty\.example\.com$`) && Proto(`tls`)
            priority: 100
        - name: 5
          addr: 10.0.1.5:443
          matcher:
            rule: HostRegexp(`^fgh\.example\.com$`) && Proto(`tls`)
            priority: 100
        - name: 6
          addr: 10.0.1.10:80
          matcher:
            rule: Host(`*.example.com`) && Proto(`http`)
            priority: 100
        - name: 7
          addr: 10.0.1.10:443
          matcher:
            rule: Host(`*.example.com`) && Proto(`tls`)
            priority: 1
ginuerzh added a commit that referenced this issue Dec 18, 2024
@zyipk zyipk closed this as completed Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant