码迷,mamicode.com
首页 > 其他好文 > 详细

haproxy 配置文件详解 之 配置文件示例

时间:2019-05-29 11:53:44      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:jsp   stat   realm   ide   测试   listen   local   for   default   

此示例文件在haproxy1.8.20 测试没有问题:

global
    log 127.0.0.1 local0 info
    maxconn 4096
    user nobody
    group nobody
    daemon
    nbproc 1
    pidfile /usr/local/haproxy/logs/haproxy.pid

defaults
    mode http
    retries 3
    timeout connect 10s
    timeout client 20s
    timeout server 30s
    timeout check 5s

frontend www
    bind *:80
    mode http
    option httplog
    option forwardfor
    option httpclose
    log global
    #acl host_www hdr_dom(host) -i www.zb.com
    #acl host_img hdr_dom(host) -i img.zb.com
    #use_backend htmpool if host_www
    #use_backend imgpool if host_img
    default_backend htmpool

backend htmpool
    mode http
    option redispatch
    option abortonclose
    balance static-rr
    cookie SERVERID
    option httpchk GET /index.jsp
    server 237server 192.168.81.237:8080 cookie server1 weight 6 check inter 2000 rise 2 fall 3
    server iivey234 192.168.81.234:8080 cookie server2 weight 3 check inter 2000 rise 2 fall 3

backend imgpool
    mode http
    option redispatch
    option abortonclose
    balance static-rr
    cookie SERVERID
    option httpchk GET /index.jsp
    server host236 192.168.81.236:8080 cookie server1 weight 6 check inter 2000 rise 2 fall 3

listen admin_stats
    bind 0.0.0.0:9188
    mode http
    log 127.0.0.1 local0 err
    stats refresh 30s
    stats uri /haproxy-status
    stats realm welcome login\ Haproxy
    stats auth admin:admin~!@
    stats hide-version
    stats admin if TRUE

 

haproxy 配置文件详解 之 配置文件示例

标签:jsp   stat   realm   ide   测试   listen   local   for   default   

原文地址:https://www.cnblogs.com/yyxianren/p/10942880.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!