【发布时间】:2016-05-17 22:54:04
【问题描述】:
我有一台服务器,其中包含许多应用程序和一个演示页面(由 Apache 提供)。
www 子域将是我的演示页面,子域将是应用程序。
目前,我只有一个用 NodeJs 编写的应用程序(例如端口 4000)。
我想将流量从 xxx.mydomain.com 重定向到 localhost:4000,它正在使用此配置:
<VirtualHost *:443>
ServerName xxx.mydomain.com:443
SSLProxyEngine On
SSLCertificateFile /root/cert.crt
SSLCertificateKeyFile /root/privatekey.key
SSLCertificateChainFile /root/cert.ca-bundle
<Location />
ProxyPreserveHost On
ProxyPass http://127.0.0.1:4000/
ProxyPassReverse http://127.0.0.1:4000/
</Location>
</VirtualHost>
我的问题是 apache 自动将 www.mydomain.com 重定向到 xxx.mydomain.com 并且我收到证书错误,因为 xxx.domain.com 已针对此子域进行了认证,而不是 www.mydomain.com。
我将此配置放在与 xxx.domain.com 虚拟主机相同的文件中:
<VirtualHost *:433>
ServerName www.mydomain.com:443
DocumentRoot /var/www/html
SSLEngine On
SSLCertificateFile /root/wwwcert.crt
SSLCertificateKeyFile /root/wwwkey.key
SSLCertificateChainFile /root/wwwcert.ca-bundle
</VirtualHost>
我该怎么办?
非常感谢!
【问题讨论】: