我如何使用acl在haproxy中返回400错误代码

时间:2018-07-12 15:22:47

标签: haproxy

我正在使用Haproxy 1.8,并且有很多我想退休的端点。该配置包含更多的前端和后端,它们可供保留,但是对于那些我想退休的人员,我想向客户端返回400错误代码。

我当时正在考虑以这种形式使用ACL:

acl host_website1.domain.tld hdr_dom(host) -m beg website1
acl host_website2.domain.tld hdr_dom(host) -m beg website2
acl host_website3.domain.tld hdr_dom(host) -m beg website3

现在,这就是条件,但是我不确定如何指示HAP返回http 400错误代码。

1 个答案:

答案 0 :(得分:0)

http-request deny deny_status 400 if host_website1.domain.tld
相关问题