我已经在这里和互联网上进行了大量的浏览,但我无法配置我的 apache 将 https 反向代理为 http。不过我觉得我已经很接近了。我遵循的所有示例似乎都适用于除我之外的每个人,而且我的设置非常简单。
<VirtualHost *:443>
ServerName myserver
SSLEngine On
SSLCertificateFile /path/to/file
SSLCertificateKeyFile /path/to/file
SSLCertificateChainFile /path/to/file
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://myserver:8081/
ProxyPassReverse / http://myserver:8081/
ErrorLog logs/myserver-error_log
CustomLog logs/myserver-access_log common
</VirtualHost>
所以当我去https://我的服务器/ https://myserver/我希望它重定向到运行 Nexus 的端口。
在我使用 SSL 之前,这实际上适用于 VirtualHost *:80。我可以去http://我的服务器/ http://myserver/并最终到达 Nexus。不知道为什么 https 不起作用。
实际发生的事情是https://我的服务器/ https://myserver/去https://我的服务器 https://myserver并显示我在 DocumentRoot 中设置的测试index.html。
事实证明 443 端口发生了一些奇怪的事情。
httpd 正在侦听该端口,来自另一台计算机的 nmap 命令显示 443 打开,但由于某种原因,无论 RHEL 7 的 VM 设置如何,它都无法工作。
因此,我切换了端口,下面的配置最终使我的反向代理通过 https 进入 apache,通过 http 进入我的 Nexus 存储库。
Nexus 返回一个带有 http 链接的网页,该链接无法获取该页面的内容,但我只需要 Docker 守护程序的 SSL,该守护程序不会请求网页。
Listen 8082
<VirtualHost *:8082>
ServerName myserver
SSLEngine On
SSLCertificateFile /path/to/file
SSLCertificateKeyFile /path/to/file
SSLCertificateChainFile /path/to/file
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://myserver:8081/
ProxyPassReverse / http://myserver:8081/
ErrorLog logs/myserver-error_log
CustomLog logs/myserver-access_log common
</VirtualHost>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)