首页 > 其他 > 详细

HAProxy 配置文件

时间:2021-04-27 20:25:32      阅读:29      评论:0      收藏:0      [点我收藏+]

global
    log         127.0.0.1 local2 info
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     20480
    nbproc     8
    user        haproxy
    group       haproxy
    daemon
    stats socket /var/lib/haproxy/stats
defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    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
    stats refresh 30s
    stats realm Welcome Login Haproxy\ Statistics
    stats uri /haproxy-admin
    stats auth admin:admin~!@
    stats hide-version
    stats admin if TRUE

frontend  Web_Service
    bind *:80
    mode http
    log global
    option httplog
    option forwardfor
    option httpclose
    option logasap
    option dontlognull
    #capture request header Host len 20
    #copture request header Referer len 20
    default_backend             web
backend web
    mode http
    option redispatch
    option abortonclose
    balance source
    cookie SERVERID
    #option httpchk GET /index.html
    server  web1 192.168.199.203:80 cookie server1 weight 1 check inter 2000 rise 2 fall 3
    server  web2 192.168.199.204:80 cookie server2 weight 1 check inter 2000 rise 2 fall 3

 

 转载自:https://www.xwroot.com/archives/haproxy-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6/

HAProxy 配置文件

原文:https://www.cnblogs.com/wang-hongwei/p/14709897.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!