如何使Apache代理http请求到https

时间:2012-04-02 13:17:44

标签: apache svn ssl proxy reverse-proxy

我正在尝试使用here所述的透明代理来配置svn镜像,但是使用https会遇到困难。
目前的设置是:

  • 主服务器可公开获取,受https。
  • 保护
  • slave服务器位于nginx反向代理后面,通过http服务,但是nginx用https保护所有外部流量。

所以我设法设置svnsync来处理这个奇怪的设置,但是与writethruproxy斗争:
mod_proxy_http在另一端不喜欢https,并说:

[debug] proxy_util.c(1525): [client ccc.ccc.ccc.ccc] proxy: *: found reverse proxy worker for https://xxx.xxx.xxx.xxx:yyyy/svn/my_repo/!svn/me
[debug] mod_proxy.c(1020): Running scheme https handler (attempt 0)
[debug] mod_proxy_http.c(1954): proxy: HTTPS: declining URL https://xxx.xxx.xxx.xxx:yyyy/svn/my_repo/!svn/me (mod_ssl not configured?)
[debug] mod_proxy_ajp.c(677): proxy: AJP: declining URL https://xxx.xxx.xxx.xxx:yyyy/svn/my_repo/!svn/me
[debug] mod_proxy_ftp.c(842): proxy: FTP: declining URL https://xxx.xxx.xxx.xxx:yyyy/svn/my_repo/!svn/me - not ftp:
[debug] mod_proxy_connect.c(100): proxy: CONNECT: declining URL https://xxx.xxx.xxx.xxx:yyyy/svn/my_repo/!svn/me
[warn] proxy: No protocol handler was valid for the URL /svn/brisbane/!svn/me. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

TLDR:有什么方法可以配置mod_ssl和mod_proxy_http来将http流量转发到https?

  • TIA

1 个答案:

答案 0 :(得分:3)

您首先需要在Debian / Ubuntu框中启用mod_ssl(例如a2enmod ssl,或者根据您的安装需要更改配置以加载模块)。

然后,您需要按照mod_proxy文档中的说明配置SSLProxy*指令,更具体地说,至少SSLProxyCACertificateFileSSLProxyCACertificatePath与您的CA一起使用我愿意相信(因为你的Apache Httpd服务器将成为这方面的客户)。