haproxy frontend 和backend

               
<pre name="code" class="sql">frontend接收请求的前端虚拟节点,Frontend可以根据规则直接指定具体使用后端的 backend(可动态选择)。 backend后端服务集群的配置,是真实的服务器,一个Backend对应一个或者多个实体服务器。forntend:用于定义一系列监听的套接字,这些套接字可以接受客户端请求并与子建立连接frontend        www        bind            *:80        bind            *:443                   ssl                     crt                     /etc/haproxy/cert.pem        redirect scheme https if !{ ssl_fc }frontend  http        bind            *:80        bind            *:443                   ssl                     crt                     /etc/haproxy/cert.pemfrontend http_80_in   这个名字自己定义backend webserver_8001        mode            http        balance         roundrobin        server          webhost01_8001          1.22.05.17:8001     check inter 2000 fall 3        server          webhost02_8001          10.18.2.1:8001       check inter 2000 fall 3===================================360buy haproxy 配置例子=========================frontend http_80        bind 0.0.0.0:80        log             global        acl index       url_end / index.html index.htm index.asp index.aspx index.php index.jsp        use_backend     index_rr if index        acl img         url_end .gif .jpg  .jpeg        use_backend     img_hash if img        acl statis      url_reg  \.(css|js|swf|png|css?.*|js?.*)$        use_backend     www_any if statis        default_backend www_anybackend index_rr        balance         roundrobin        log             global        cookie          SERVERID        option          httpchk GET /robots.txt HTTP/1.1\r\nHost:www.360buy.com        server          www-80-21     192.168.71.21:80    check inter 3000 rise 1 fall 1 maxconn 65535backend img_hash        balance         uri len 15        log             global        cookie          SERVERID        option          httpchk GET /robots.txt HTTP/1.1\r\nHost:www.360buy.com        server          img-80-51     192.168.71.51:80    check inter 3000 rise 1 fall 1 maxconn 65535backend www_any        balance         uri len 15        log             global        cookie          SERVERID        option          httpchk GET /robots.txt HTTP/1.1\r\nHost:www.360buy.com        server          www-80-21     192.168.71.21:80    check inter 3000 rise 1 fall 1 maxconn 65535[北京]Jimin(49790735210:34:24对访问比较大的index页面作轮询,其它的页面对urlhash,分到一台服务器上,以提高命中率url len 15 以URI的前15位做hash


            

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值