haproxy.cfg

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

defaults 
        mode tcp
        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
    default_backend htmpool

backend htmpool
    mode http 
    option redispatch
    option abortonclose
    balance roundrobin
    cookie SERVERID
    option httpchk GET /index.php 
    server web1 10.1.1.1:80 cookie server1 weight 6 check inter 2000 rise 2 fall 3
    server web2 10.1.1.2:80 cookie server2 weight 6 check inter 2000 rise 2 fall 3

listen admin_status
    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 
    stats auth admin:admin 
    stats hide-version 
    stats admin if TRUE
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章