【问题标题】:how can I return 400 error code in haproxy using acl如何使用 acl 在 haproxy 中返回 400 错误代码
【发布时间】:2018-07-13 08:34:49
【问题描述】:

我正在使用 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 错误代码。

【问题讨论】:

    标签: haproxy


    【解决方案1】:
    http-request deny deny_status 400 if host_website1.domain.tld
    

    【讨论】:

      猜你喜欢
      • 2023-04-09
      • 1970-01-01
      • 2012-11-08
      • 2019-07-12
      • 2019-11-14
      • 2020-09-06
      • 2014-05-11
      • 2023-02-26
      • 2015-09-04
      相关资源
      最近更新 更多