<pre name="code" class="sql"><pre name="code" class="sql">frontend http
bind *:80
bind *:443 ssl crt /etc/haproxy/cert.pem
redirect scheme https if !{ ssl_fc }
acl host_zjcap.cn hdr_beg(host) -i zjcap.cn
acl host_zjzb.cn hdr_beg(host) -i zhongjunziben.com
acl www_zjzb.cn hdr_beg(host) -i www.zhongjunziben.com
acl host_zjzc.cn hdr_beg(host) -i zhongjunzichan.com
acl www_zjzc.cn hdr_beg(host) -i www.zhongjunzichan.com
redirect prefix http://www.zjcap.cn if host_zjcap.cn
redirect prefix http://www.zjcap.cn if host_zjzb.cn
redirect prefix http://www.zjcap.cn if www_zjzb.cn
redirect prefix http://www.zjcap.cn if host_zjzc.cn
redirect prefix http://www.zjcap.cn if www_zjzc.cn
hdr_beg(host) 这个是hdr_beg 匹配开头 所以 需要www单独做一条acl