如何设置 apache 来执行从 http -> https 的反向代理?

如何设置 apache 来执行从 http -> https 的反向代理?

我需要嗅探 VisualStudio 和 Web 服务端点之间的一些流量。我不确定他们如何将用户名和密码与 wsdl 请求一起发送。

如何配置 Apache 以通过 http 接受请求并通过 https 将其反向代理到真实服务器

您最终会收到如下错误消息:

Proxy Error

The proxy server could not handle the request GET /.
Reason: Error during SSL Handshake with remote server

Apache/2.4.7 (Ubuntu) Server at 10.60.60.6 Port 80

我需要 Visual Studio 的流量清晰明了,这样我才能看到他们是如何传递用户名/密码的。API 另一端的人似乎都不知道,他们只是说使用 Visual Studio。如果我们的解决方案不在 Linux 上运行,那就没问题了。

答案1

你需要使用mod_proxymod_sslapache 模块以便能够代理 SSL 请求。首先,您必须启用这些模块。然后,您需要在虚拟主机条目中添加 SSLProxyEngine、ProxyPass、ProxyPassReverse、SSLCAProxyCertificateFile、SSLCAProxyCertificatePath 指令。

<VirtualHost 1.2.3.4:80>
     ServerName my.server.name 
     SSLProxyEngine on 
     ProxyPass /secure https://secure.com
     ProxyPassReverse https://secure.com
     SSLCAProxyCertificateFile /path/to/ca_folder/certificate
     SSLProxyCACertificatePath /path/to/ca_folder
</VirtualHost>

我还没有测试过这个确切的配置,但我认为它会起作用。请记住,此配置不适合公共服务器!希望有帮助!

相关内容