Haproxy支持SSL配置
Haproxy 版本需要在1.5以上才支持SSLhaproxy 代理 ssl 有两种方式
1、haproxy 本身提供ssl 证书,后面的web 服务器走正常的http ,这种方式需要重新编译haproxy
2、haproxy 本身只提供代理,后面的web服务器https,这种方式不需要重新编译
方式一:
重新编译安装
make TARGET=linux3100 USE_OPENSSL=1 ADDLIB=-lz clean all
make install
# ldd haproxy| grep ssl
libssl.so.10 => /lib64/libssl.so.10 (0x00007f5ab8264000) 修改haproxy.cfg配置文件
global
tune.ssl.default-dh-param 2048 //修改默认使用2048bit加密,不设置会有警告
frontend http-in
bind *:443 ssl crt /root/server.pem //配置ssl支持,这里pem文件是证书和私钥合并而成的, cat servername.crt servername.key |tee servername.pem
reqadd X-Forwarded-Proto:\ https //http和https并存
redirect scheme https if !{ ssl_fc } //http跳转https 方式二:
需要后置服务器本身支持https,那么只要进行如下配置:
frontend https
bind *:443
mode tcp
default_backend weblogic
backend weblogic
mode tcp
balance source
server s1 10.20.2.233:443
注意,这种模式下mode 必须是tcp 模式
页:
[1]