haproxy经典配置

 cat /etc/haproxy/haproxy.cfg
global
    log 127.0.0.1 local3 warning
    chroot  /var/lib/haproxy
    pidfile /var/run/haproxy.pid
    maxconn 65535   
    user    haproxy
    group   haproxy
    daemon
    stats socket /var/lib/haproxy/stats
    #tune.ssl.default-dh-param 2048
defaults
    mode                    tcp
    log                     global
    option                  tcplog
    option                  dontlognull
    option http-server-close
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

frontend site-tcp
    mode tcp
    bind *:8080
    default_backend website
backend website
    mode tcp
    option tcplog
    #option ssl-hello-chk
    balance roundrobin
    server  serverA   192.168.10.10:8080 weight 10 check inter 2s rise 2 fall 3
    
listen admin_stats
    stats   enable      
    bind    *:9088     
    mode    http 
    option  httplog
    log     global
    maxconn 10       
    stats   refresh 30s
    stats   uri /admin
    stats   realm haproxy       
    stats   auth admin:admin
    stats   hide-version
    stats   admin if TRUE

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值