本文共 695 字,大约阅读时间需要 2 分钟。
HAProxy同时对80和443做负载均衡:
注:
1、该操作依据Redhat/CentOS 6系统2、https使用mode tcp(不需要配置crt,使用实际web的crt)3、需注掉option httplog和option forwardfor except 127.0.0.0/8frontend main *:80
stats uri /haproxy?statsdefault_backend httpbackend http
balance roundrobinserver 10.0.0.3 10.0.0.3:80 checkserver 10.0.0.4 10.0.0.4:80 checkfrontend main *:443mode tcpdefault_backend https
backend https
mode tcpbalance roundrobinserver 10.0.0.3 10.0.0.3:443 checkserver 10.0.0.4 10.0.0.4:443 check:wq
验证:
浏览器访问: (推荐域名访问),
haproxy状态页面: (可以看http和https分配情况)
转载于:https://blog.51cto.com/yangzhiming/2157014