背景信息:(底部的问题)
我正在尝试连接到一个拥有 8 台服务器的客户端,所有这些服务器都有唯一的 IP 地址。客户端在所有服务器上使用相同的 SSL 证书(对于此示例,证书名称 == www.all_servers.com)。客户端只允许通过 https 传入请求。
我正在尝试使用 mod_proxy 创建一个 apache 代理,该代理将不同的 URI 映射映射到不同的服务器。例如:
https://PROXY_SERVER/SERVER1/{REQUEST}
这会将 {REQUEST} 发送到 server1
https://PROXY_SERVER/SERVER2/{REQUEST}
会将 {REQUEST} 发送到 server2。到目前为止,非常简单。
在 Apache 2.2 中,这可以通过使用 IP 地址来实现,如下所示:
SSLProxyEngine On
ProxyPass /server1 https://1.1.1.1/
ProxyPassReverse /server1 https://1.1.1.1/
ProxyPass /server2 https://1.1.1.2/
ProxyPassReverse /server2 https://1.1.1.2/
这是因为 Apache 2.2 没有检查证书是否匹配 (1.1.1.1 != www.all_servers.com)
但是,在 Apache 2.4 中,我现在遇到了证书问题(这是正确的)。(这个确切的代码适用于 apache 2.2 机器)
[Thu Oct 10 12:01:48.571246 2013] [proxy:error] [pid 13282:tid 140475667224320] (502)Unknown error 502: [client 192.168.1.1:48967] AH01084: pass request body failed to 1.1.1.1:443 (1.1.1.1)
[Thu Oct 10 12:01:48.571341 2013] [proxy:error] [pid 13282:tid 140475667224320] [client 192.168.1.1:48967] AH00898: Error during SSL Handshake with remote server returned by /server1/asd
[Thu Oct 10 12:01:48.571354 2013] [proxy_http:error] [pid 13282:tid 140475667224320] [client 192.168.1.1:48967] AH01097: pass request body failed to 1.1.1.1:443 (1.1.1.1) from 192.168.1.1 ()
我不能使用 /etc/hosts,因为一台服务器可以工作,使用:
1.1.1.1 www.all_servers.com
SSLProxyEngine On
ProxyPass /server1 https://www.all_servers.com/
ProxyPassReverse /server1 https://www.all_servers.com/
但是很多服务器不会
所以,对于实际的问题:
有没有办法强制 mod_proxy 忽略不匹配的证书。或者,有没有更好的方法来做到这一点。
感谢您对此的任何帮助!