global
log 127.0.0.1 local0
maxconn 4096
chroot /etc/haproxy
uid 501
gid 501
daemon
nbproc 1
pidfile /etc/haproxy/logs/haproxy.pid
#debug
defaults
log 127.0.0.1 local1
mode http
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
option abortonclose
#option originalto
retries 2
maxconn 4096
balance roundrobin
contimeout 5000
clitimeout 30000
srvtimeout 30000
timeout check 2000
option forwardfor
############### manage ######################
listen admin_stats
bind 0.0.0.0:7827
mode http
log 127.0.0.1 local1
stats refresh 30s #统计页面自动刷新时间
stats uri /haproxy-stats
stats realm admin\SIL #统计页面密码框上提示文本
stats auth tton:tton@admin #统计页面用户名和密码设置
#stats auth adminx:admin
stats hide-version #隐藏统计页面上HAProxy的版本信息
option forwardfor
############# website ###################
listen WebSite
bind *:80
mode http
log 127.0.0.1 local2
option httplog
option forwardfor
option httpclose
#balance source
cookie SESSION_COOKEI insert indirect nocache
#maxconn 300
balance roundrobin
server Squid1_item1_172.10.0.10 172.10.0.10:80 cookie Server1 maxconn 2000 check inter 2000 rise 3 fall 3 weight 5
server Squid1_item2_172.10.0.11 172.10.0.11:80 cookie Server1 maxconn 1200 check inter 2000 rise 3 fall 3 weight 3
server Squid1_item3_172.10.0.13 172.10.0.13:80 cookie Server1 maxconn 800 check inter 2000 rise 3 fall 3 weight 2
#server web1_item2_172.10.0.11 172.10.0.11:80 cookie Server1 maxconn 450 check inter 2000 rise 3 fall 3 weight 6
############# website ###################
listen ClearSquid
bind *:8080
mode http
log 127.0.0.1 local2
option httplog
option forwardfor
option httpclose
#balance source
server Squid1_item1 172.10.0.10:8080 cookie Server1 maxconn 50 check inter 2000 rise 3 fall 3 weight 1