我有使用http和https的haproxy v1.5.4。我将*:80&:* 443绑定到相同的前端并使用相同的ACL。
我想创建一个http-> https重定向
frontend http-in
bind *:80
bind *:443 ssl crt /etc/pki/tls/certs/...
...
acl is_office path_beg /office
http-request redirect scheme https if !{ ssl_fc } is_office
use_backend office if is_office
此原因
10.XXXXX:36909 [16/Dec/2015:17:23:07.678] http-in/2: SSL handshake failure
当我通过http访问时(期望重定向)
如果我通过https访问,那么它将正确地访问后端并通过443代理到服务。
backend office
balance roundrobin
server backbone-daily 10.XXXXXX:443 ssl check verify none
自签名证书将在没有重定向的情况下进行验证并起作用。感觉好像我在重定向阶段丢失了一些东西。
非常感谢您的帮助
由于我们将HAProxy插件与仅具有GUI的OPNsense一起使用,因此我无法给出包含工作代码的答案。但是,我可以追溯最终使我们完成这项工作的步骤。
http-request redirect scheme https
frontend http-in
bind *:443 ssl crt /etc/pki/tls/certs/...
use_backend office if is_office
frontend no-ssl-http-in
bind *:80
http-request redirect scheme https
希望这可以帮助仍在寻找解决方案的任何人。