HAPROXY 2.0.6-使用 Stick Tables 限制 Http 请求率以预防 DDOS

HAPROXY 2.0.6-使用 Stick Tables 限制 Http 请求率以预防 DDOS

我尝试使用“stick-table”通过 haproxy 限制后端 nginx 服务器的 http 请求率,但配置后我重新启动 haproxy 后,似乎“track-sc0”不被接受。有人能帮我吗?以下是“haproxy.cfg”和“haproxy.log”的快照

   frontend proxy_front
     http-request track-sc0 src table proxy_back
     http-request deny if { sc_http_req_rate(0) gt 100 }
     default_backend proxy_back

   backend proxy_back
     mode http
     stick-table type ip size 100K expire 10s store http_req_rate(10s)
     server Nginx x.x.x.x:x maxconn 10000


Following is the log generated by haproxy

May 20 15:36:45 ext-proxy1 haproxy-systemd-wrapper: [ALERT] 140/153645 (79155) : parsing 
[/etc/haproxy/haproxy.cfg:35]: 'http-request' expects 'allow', 'deny', 'auth', 'redirect', 
'tarpit', 'add-header', 'set-header', 'replace-header', 'replace-value', 'set-nice', 'set-tos',
'set-mark', 'set-log-level', 'add-acl', 'del-acl', 'del-map', 'set-map', but got 'track-sc0'.

May 20 15:36:45 ext-proxy1 haproxy-systemd-wrapper: [ALERT] 140/153645 (79155) : Error(s)  
found in configuration file : /etc/haproxy/haproxy.cfg

May 20 15:36:45 ext-proxy1 haproxy-systemd-wrapper: haproxy-systemd-wrapper: exit,  
haproxy RC=1

相关内容