Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239928
  • 博文数量: 49
  • 博客积分: 246
  • 博客等级: 二等列兵
  • 技术积分: 1034
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-02 13:18
文章分类

全部博文(49)

分类: 系统运维

2015-06-19 11:31:03


点击(此处)折叠或打开

  1. global

  2.     log 127.0.0.1 local2
  3.     chroot /var/lib/haproxy
  4.     pidfile /var/run/haproxy.pid
  5.     maxconn 51200
  6.     nbproc 1
  7.     user haproxy
  8.     group haproxy
  9.     daemon
  10.     stats socket /var/lib/haproxy/stats

  11. defaults
  12.     mode http
  13.     log global
  14.     option httplog
  15.     option dontlognull
  16.     option http-server-close
  17.     option redispatch
  18.     retries 3
  19.     timeout http-request 10s
  20.     timeout queue 1m
  21.     timeout connect 10s
  22.     timeout client 1m
  23.     timeout server 1m
  24.     timeout http-keep-alive 10s
  25.     timeout check 10s
  26.     maxconn 5000


  27. frontend app.com
  28.     bind *:8080
  29.     log 127.0.0.1 local3

  30.     acl ip_list src 1.1.1.1
  31.     http-request deny if ip_list
  32.     http-request allow

  33.     acl acbbs url_beg /bbs
  34.     #redirect /form if /bbs



  35.         acl www_app hdr_beg(host) -i www.app.com
  36.         use_backend www.app.com if www_app

  37.     acl static_app hdr_beg(host) -i static.app.com
  38.     acl static_domain path_beg -i /static /images /javascript /group(\d)/M00
  39. #    acl static path_end -i .html .jpg .jpeg .gif .png .css .js
  40.     use_backend static.app.com if static_app or static_domain
  41. #    acl static hdr(host) -i app.com

  42.         default_backend www.app.com


  43. backend www.app.com
  44.      option forwardfor
  45.      balance roundrobin
  46.      option httpchk HEAD /index.jsp
  47.      cookie node insert nocache
  48.      server app1 127.0.0.1:80 cookie app1 check inter 2000 rise 3 fall 3
  49. #     server app2 127.0.0.1:20080 cookie app2 check inter 2000 rise 3 fall 3


  50. backend static.app.com
  51.      option forwardfor
  52.          balance roundrobin
  53.      #balance uri len 15 #url_hash
  54.      cookie node insert nocache
  55.      option httpchk HEAD /index.html
  56.      server static238 172.20.10.238:80 cookie static238 check inter 2000 rise 3 fall 3
  57.      server static239 172.20.10.239:80 cookie static239 check inter 2000 rise 3 fall 3


  58. listen admin_status
  59.     bind 0.0.0.0:8081
  60.         stats refresh 10s
  61.     stats uri /monitor_status
  62.     stats realm Haproxy\ Statistics
  63.     stats auth admin:admin

阅读(2600) | 评论(0) | 转发(0) |
0

上一篇:路由交换基础

下一篇:SSH 脚本 二次认证

给主人留下些什么吧!~~