我想通过HAProxy将子域从域A重定向到域B的子域。我有这两个域的SSL通配符。
我担心的是,HAProxy在重定向时使用了错误的证书(它使用的是用于重定向用户的域的证书而不是所用域的证书)。
以下是我的配置文件:
HAProxy(/etc/haproxy/haproxy.cfg):
func onMoreTabRefresh() {
if let tabbarItem = tabBarViewController.tabBar.items?[RootTab.More.rawValue] {
tabbarItem.badgeValue = "8"
}
}
UITabBarItem.appearance().badgeColor = UIReferences.Color.badgeOrangeColor
证书(/ etc / haproxy / ssl_certificates):
...
frontend https
bind 0.0.0.0:443 ssl crt-list /etc/haproxy/ssl_certificates no-sslv3 no-tls-tickets ciphers ECDHE-ECDSA-CHACHA20-POLY1305:EC.......
mode http
acl is_domain_b hdr(host) -i sub2.sub1.b.com
acl is_domain_a hdr(host) -i sub1.a.com
default_backend redir
option http-server-close
option forwardfor except 127.0.0.1
http-request redirect prefix https://sub1.a.com if is_domain_b
use_backend xxxxx if is_domain_a
backend redir
mode http
redirect prefix sub1.domain-a.com code 302
backend xxxxx
mode http
option forwardfor
option httpchk HEAD / HTTP/1.1\r\nHost:healthcheck.haproxy
server xxxxx xx.xx.xx.xx:3000 check
演示:
/etc/ssl/haproxy/a.com.pem
/etc/ssl/haproxy/b.com.pem
我想指出,自从我使用SSL通配符以来,这个问题才出现。以前,每个子域都有一个SSL证书,HAProxy使用正确的证书(对于相同的配置)。
您知道我的配置中可能存在什么问题吗?