haproxy acl 无法在 https/tcp 模式下工作
我遇到了一些问题,似乎我无法让 acl 在 tcp 模式下工作,
一切都在 http 模式下工作。
这是我的配置。
frontend http *:80
acl http_test_acl path_beg -i /test
use_backend http_test if http_test_acl
default_backend http_default
backend http_test
balance roundrobin
server httptest 10.10.10.10:80 check
backend http_default
balance roundrobin
server httpdefault 10.10.10.10:80 check
############# HTTPS #################
frontend https *:443
mode tcp
acl https_test_acl path_beg -i /test
use_backend https_test if https_test_acl
default_backend https_default
backend https_test
mode tcp
balance roundrobin
server httpstest 10.10.10.10:443 check
backend https_default
mode tcp
balance roundrobin
server httpsdefault 10.10.10.10:443 check
不要关注ip 10.10.10.10,因为我已经隐藏了我原来的ip。您能否让我知道为什么 https 不起作用,http 前端/后端 acl 规则工作得很好。
干杯
I am experiencing some problems, it seems I can't get acl's to work in tcp mode,
everything works in http mode.
Here is my config.
frontend http *:80
acl http_test_acl path_beg -i /test
use_backend http_test if http_test_acl
default_backend http_default
backend http_test
balance roundrobin
server httptest 10.10.10.10:80 check
backend http_default
balance roundrobin
server httpdefault 10.10.10.10:80 check
############# HTTPS #################
frontend https *:443
mode tcp
acl https_test_acl path_beg -i /test
use_backend https_test if https_test_acl
default_backend https_default
backend https_test
mode tcp
balance roundrobin
server httpstest 10.10.10.10:443 check
backend https_default
mode tcp
balance roundrobin
server httpsdefault 10.10.10.10:443 check
Don't pay attention to ip 10.10.10.10 as I have hidden my orginal one. Could you please let me know why https is not working, http frontend/backend acl rules are working just fine.
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为您的 https 服务器处于 tcp 模式(因为它们应该用于 ssl),所以第 7 层规则不起作用。
Cause your https servers are in tcp mode (as they should be for ssl), so a layer 7 rule wont work.
要使 ACL 正常工作,请禁用 tcp 模式,然后在后端服务器上设置 ssl(因此使用 ssl 关键字)。
或者,不必在两台后端服务器上设置 ssl;在后端服务器中使用私有 IPS 并确保后端服务器上的端口不对外界开放
for acl to work, disable tcp mode then set up ssl on the servers on your backend(hence the ssl keyword)
Alternatively instead of having to setup ssl on both your backend servers; use private IPS in the backend servers and make sure ports on the backend servers arent open to the world