Linux haproxy配置参数

http-request

  option http-server-close

  option http-pretend-keepalive

  option httpclose

  option redispatch

  redirect

  reqadd

  rspadd

tcp-request

ACL <name> <criterion> [flags] [operator] <value>

[flags] 

  -i 不区分大小写

  -f 发从制定文件种加载模式

  -- 标识符的强制结束标记

<criterion>

  be_sess_rate  用于测试指定的backend上会话创建的速率,常用于在指定backend上的会话创建速度过高时将用户请求转发至另外的backend。用于阻止攻击行为

    backend test

      mode http

      acl being_scanned be_sess_rate gt 50

      redirect location /error_pages/denied.html if being_scanned

  fe_sess_rate 用于测试指定的frontend上的会话创建速率是否满足条件,常用于为frontend指定一个合理的会话创建速率以防止服务被滥用。

    frontend mial

      bind:25

      mode tcp

      maxconn 500

      acl too_ fast fe_sess_rate gt 50

      tcp-request inspect-delay 500ms

      tcp-request content accept if ! too_fast

      tcp-request content accept if WAIT_END

  acl header_info hdr(Connection) -i close

  acl method_info method GET

  acl url_begin path_beg -i /static /images

  acl url_end path_end -i .jpg .js .css

  acl header_begin hdr_beg img. ftp.

  acl header_end hdr_end 

  acl url_begin url_beg http://

  acl url_end url_end

    

原文地址:https://www.cnblogs.com/houyongchong/p/10601411.html