haproxy项目配置



[root@mail conf]# cat haproxy.cfg
global
  chroot /usr/local/haproxy # more secure
  daemon
  nbproc 1
  group nobody
  user nobody
  log 127.0.0.1 local0 info # syslog
  pidfile /usr/local/haproxy/logs/haproxy.pid
  ulimit-n 65536
  spread-checks 5m # percent of randomness in the check interval
  stats timeout 5m
  stats maxconn 100
defaults
  log global
  mode tcp
  retries 3
  option redispatch
  option abortonclose
  maxconn 32000
  contimeout 5m
  clitimeout 5m
  timeout check 5m
  timeout client 5m
  timeout connect 5m
  timeout server 5m
#配置端口监听
listen python1 0.0.0.0:8008
  mode tcp
  balance roundrobin
  server one1   119.147.19.43:80  weight 1 maxconn 10000 check inter 10s
# server one2   10.142.8.52:8070  weight 1 maxconn 10000 check inter 10s
#配置URL转发
frontend free
        bind *:8002
        default_backend qzxy
backend qzxy
        mode http
        option forwardfor header ORIG_CLIENT_IP
    server server1 121.14.36.6:80 redir http://xy.13qz.com:80 check inter 2000 rise 3 fall 3 weight 3
                 
#        server 121.14.36.6:80 redir http://xy.13qz.com:80 weight 10 rise 3 fall 5 check inter 2000
#配置URL转发
frontend free2
        bind *:8003
        default_backend txqz
backend txqz
        mode http
        option forwardfor header ORIG_CLIENT_IP
        #server server1 121.14.36.6:80 redir http://xy.13qz.com:80 check inter 2000 rise 3 fall 3 weight 3
    server server1 s5.app100697808.qqopenapp.com:8009 redir http://s5.app100697808.qqopenapp.com:8009 check inter 2000 rise 3 fall 3 weight 3
listen stats :8045
   mode http
   stats refresh 30s
   stats uri /haproxy_stats
   stats realm 13qz\proxy
   stats auth admin:admin


你可能感兴趣的:(haproxy)