结合 stick-table 和 url 模式

combine stick-table with url pattern

是否可以将 http-request deny 规则设置为 http_req_rate 和一些非静态 URL 模式的组合?

frontend myfrontend
  stick-table type binary len 20  size 100k  expire 10s  store http_req_rate(10s)
  http-request track-sc0 src

  http-request set-var(txn.url_prefix) path,field(2,/)

  http-request deny if { sc_http_req_rate(0) gt 1000 }

我想计算对 URL 前缀的请求(如上面的 var(txn.url_prefix))并将上述 http-request deny 与此计数器相结合。

看完后Bot Protection with HAProxy自己想办法解决

frontend myfrontend
  stick-table type binary size 1m expire 5m store gpc0,gpc0_rate(30s)
  http-request track-sc0 path,field(2,/)
  http-request sc-inc-gpc0(0)

  # optionally configure variables for logging purpose
  # http-request set-var(req.path_field2) path,field(2,/)
  # http-request capture var(req.path_field2) len 100
  # http-request set-var(req.gpc0_rate) sc_gpc0_rate(0)
  # http-request capture var(req.gpc0_rate) len 10