【发布时间】:2017-07-10 06:39:12
【问题描述】:
我在这里和 Internet 上进行了大量浏览,但我无法将我的 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://myserver/ 时,我希望它重定向到运行 Nexus 的那个端口。
在我使用 SSL 之前,这实际上适用于 VirtualHost *:80。我可以去http://myserver/ 并最终在 Nexus。不知道为什么 https 不起作用。
实际发生的是https://myserver/ 转到https://myserver 并显示我在 DocumentRoot 中设置的测试 index.html。
【问题讨论】:
-
什么是错误日志或访问日志?
-
我没看到太多。在您的评论之后,我再次查看,access_log 显示 404 试图转到“myserver”,error_log 中有一条警告级别消息,关于基于名称的 SSL 虚拟主机仅适用于具有 TLS 服务器名称指示支持的客户端。
-
你能检查一下 apache 服务于那个端口吗? netstat 还是 nmap?
-
如果这是您的要求,它正在监听 443?
-
httpd 正在监听 443,nmap 显示我的服务器已打开该端口。
标签: apache ssl reverse-proxy