首页 文章

Apache反向代理https到http

提问于
浏览
1

我在这里和互联网上做了相当多的浏览,但我无法配置我的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 .

1 回答

  • 3

    结果发现443端口正在进行一些时髦的事情 .

    httpd正在侦听该端口,来自另一台机器的nmap命令显示443打开但由于某种原因,但是RHEL 7的VM已经设置,它无法正常工作 .

    所以我切换端口,下面是配置,最终得到我的反向代理到https到apache和http到我的Nexus repo .

    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>
    

相关问题