apache的ProxyRemote可以用来代理HTTPS请求到mongrel进行处理吗?
因此,我有一个使用 mongrel 用 ruby 编写的自定义代理来处理一些相当复杂的缓存逻辑。 这对于 http 和 ftp 请求都非常有效,但是由于 mongrel 不是为处理 https 请求而设计的,因此我希望使用 apache 来处理整个事情,并使用 ProxyRemote 命令传递给 mongrel 来处理 https 请求。
通过 apache 中的 ProxyPass 和 ProxyPassReverse 命令来镜像某些站点目录结构很容易完成这种事情,但我没有看到使用 ProxyRemote 来做到这一点的方法。
问题是 mongrel 不处理为建立安全请求而发出的 CONNECT 请求。 因此,虽然我能够在代理本身内处理 https 请求,但实际上不支持直接将代理与 https 请求一起使用。
看来最简单的解决方案是让 apache 处理 https 请求,然后简单地将 http 请求本身(减去 CONNECT)传递给 mongrel 并让它适当地处理它并将其返回给 apache,然后返回给客户端。
所以我的问题是,有没有办法让 ProxyRemote 的工作方式与 ProxyPass 处理 HTTP 请求的方式相同(即将未加密的请求传递给 mongrel)?
So I have a custom proxy that is written in ruby using mongrel to handle some fairly complex caching logic. This works great for both http and ftp requests, however since mongrel is not designed to handle https requests, I wish to front the whole thing with apache and make use of the ProxyRemote command to pass through to mongrel for https requests.
This sort of thing is easily accomplished to mirror certain site directory structures via the ProxyPass and ProxyPassReverse commands in apache, but I don't see a way to do this using ProxyRemote.
The problem is that mongrel does not handle CONNECT requests which are made to establish a secure request. So while I am able to handle https requests within the proxy itself, actually using the proxy with an https request directly is not supported.
It seems that the simplest solution would be to have apache handle the https request and then simply pass the http request itself (minus the CONNECT) to mongrel and have it handle it appropriately and return it to apache and then to the client.
So my question is, Is there a way to make ProxyRemote work the same way that ProxyPass does with HTTP requests (i.e. pass an unencrypted request to mongrel)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需使用 ProxyPass 和 ProxyPassReverse,你的反向代理(apache)和你的杂种之间的连接将看到正常的普通 http :),不需要魔法(特别是不需要 CONNECT,据我所知,这只是转发代理的可能,但我不确定)。
Just use ProxyPass and ProxyPassReverse, the connection between your reverse proxy (apache) and your mongrel will see normal plain http :), no magic necessary (especially not CONNECT, afaik thats only possbile for forward proxies, but I'm not sure).
嗯,你尝试过这样做吗?
我一直在使用 apache 执行 https 并仅使用旧的默认 .htaccess mod_rewrite 规则传递请求。
Hum, have you tried to do so ?
I've been using apache to do the https and just pass the requests with the old default .htaccess mod_rewrite rules.