HAProxy Lua无法在

问题描述 投票:0回答:1

我有用于haproxy的lua脚本,该脚本在白名单中检查了ip,我需要将其添加到haproxy配置中。我需要在TCP连接上执行此操作,正如[C​​0]帖子所述-我可以执行此操作。

haproxy blog

但是如果我使用tcp-request connection <action> tcp-request content <action> tcp-response content <action> http-request <action> http-response <action> -haproxy无法以错误消息开头:

tcp-request connection lua.checkip

但是我可以使用haproxy[9384]: [ALERT] 124/000121 (9384) : parsing [/etc/haproxy/haproxy.cfg:42] : 'tcp-request connection' expects 'accept', 'reject', 'track-sc0' ... 'track-sc2', 'sc-inc-gpc0(*)', 'sc-inc-gpc1(*)', 'sc-set-gpt0(*)', 'set-src', 'set-src-port', 'set-dst', 'set-dst-port', 'silent-drop' in frontend 'haproxy_rserve' (got 'lua.checkip').并且可以正常工作。] >>

据我所知,这两个函数必须具有差异,对我来说,最佳解决方案是tcp-request content lua.checkip还是可以使用connetion?我正在尝试构建一个高负载的系统,所以我不想在配置阶段搞砸。

我尝试将这些行添加到前端:

content

我有用于haproxy的lua脚本,该脚本在白名单中检查了ip,我需要将其添加到haproxy配置中。我需要在tcp连接上执行此操作,正如haproxy博客文章所说-我可以执行此操作。 tcp-request ...

haproxy
1个回答
0
投票

[查看tcp-request inspect-delay 5s tcp-request connection lua.checkip tcp-request connection reject if { var(req.blocked) -m bool } 显示,注册Lua the source操作确实仅是针对内容,而无法注册用于连接的Lua操作:

© www.soinside.com 2019 - 2024. All rights reserved.