我有一个服务器frontend.example.com与公共IP。 它的Apache(2.4)应该代理service1.example.com (DNS别名frontend.example.com )的stream量。
service1.example.com是两个私有LAN( 192.168.56.0 )之间的虚拟机。
现在,这对HTTP很简单:
<VirtualHost *:80> ServerName service1.example.com ProxyPass / http://192.168.56.2/ ProxyPassReverse / http://192.168.56.2/ <Location "/"> Require all granted </Location> </VirtualHost>
我正在尝试为HTTPS做同样的事情:
<VirtualHost *:443> ServerName service1.example.com SSLEngine On SSLProxyEngine On ProxyRequests Off SSLProxyCheckPeerCN off SSLProxyCheckPeerExpire off SSLInsecureRenegotiation on SSLProxyVerify none SSLVerifyClient none SSLCertificateFile /etc/ssl/certs/example_com.crt SSLCertificateKeyFile /etc/ssl/certs/example_com.key ProxyPass / https://192.168.56.2/ ProxyPassReverse / https://192.168.56.2/ <Location "/"> Require all granted </Location> </VirtualHost>
试图通过HTTPS访问service1.example.com返回: 在与远程服务器的SSL握手期间出错
安全不是我关心的地方。 service1 需要 HTTPS连接到它的一些服务,这就是为什么我不简单地代理HTTPS到HTTP。 我不想让frontend.example.com参与SSL。 我想说的是,它说:“嘿,我有443的连接,我没有处理它,我只是转发给这个内部知识产权,它会照顾它”。 我只是想让它通过请求。 可以这样做吗?
正如你在上面的HTTPSconfiguration中看到的那样,我试图尽可能地放松安全性(例如, SSLInsecureRenegotiation on是为了降低对中间人的攻击,不是吗?)。 但迄今为止没有任何工作。
显然,我唯一缺less的指令是SSLProxyCheckPeerName off 。 现在起作用了。