我需要配置两个ssl端口的haproxy

时间:2017-02-07 14:09:39

标签: ssl redirect haproxy

我有两个服务器 具有相同的URL但端口号可能会更改 我想执行重定向这两个URL由客户端输入到https。 如果我输入我的第一个URL,即example.com,那么我希望它将重定向到example.com

如果我输入第二个URL,例如example.com:8080,那么我想将它重定向到example.com:8080 请参阅我的配置

frontend www-HTTP
bind *:80
bind *:443 ssl crt /etc/apache2/ssl/apache.pem
reqadd X-Forwarded-Proto:\ https
default_backend tcp-backend
mode tcp

frontend TCP-HTTP
bind *:8080
bind *:8443 ssl crt /etc/apache2/ssl/paritech.pem
reqadd X-Forwarded-Proto:\ https
default_backend www-backend
mode tcp

backend www-backend
redirect scheme https if !{ ssl_fc }
server dev.example.com 192.168.1.120:8080 check

backend TCP-backend
redirect scheme https if !{ ssl_fc }
server qa.example.com 192.168.1.120:80 check

如何将8080重定向到8443以进行HTTPS ...

0 个答案:

没有答案