<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(497907352) 10:34:24对访问比较大的index页面作轮询,其它的页面对url做hash,分到一台服务器上,以提高命中率url len 15 以URI的前15位做hash
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow