繁体   English   中英

设置Apache以使用内部代理服务器(代理链接?)

[英]Setting up Apache to use an internal Proxy Server( Proxy Chaining? )

我遇到一种情况,我需要先通过内部代理服务器将请求路由到Apache,然后再重定向到外部站点,安装程序如下所示:

Browser Request --> Apache --> Internal Proxy Server --> External Site

没有代理服务器,我使用作为代理处理的重写来完成重定向([P])

RewriteRule ^/somepath/(.*) http://www.externalsite.com/$1 [P,QSA,L]

我发现看起来像我想要设置的转发代理后面设置apache ,并建议我尝试以下指令:

ProxyPass /somepath/ http://www.externalsite.com/
ProxyPassReverse /somepath/ http://www.externalsite.com/
ProxyRemote  http://www.externalsite.com/ http://internal.proxy.ip.addy:8080

设置好之后,我得到了503和以下Apache日志条目:

[Thu Apr 11 07:47:14 2013] [debug] mod_proxy_http.c(1973): proxy: HTTP: serving URL http://www.externalsite.com/somefile.html
[Thu Apr 11 07:47:14 2013] [debug] proxy_util.c(2011): proxy: HTTP: has acquired connection for (www.externalsite.com)
[Thu Apr 11 07:47:14 2013] [debug] proxy_util.c(2067): proxy: connecting http://www.externalsite.com/somefile.html to www.externalsite.com:80
[Thu Apr 11 07:47:14 2013] [debug] proxy_util.c(2193): proxy: connected http://www.externalsite.com/somefile.html to internal.proxy.ip.addy:8080
[Thu Apr 11 07:47:14 2013] [debug] proxy_util.c(2444): proxy: HTTP: fam 2 socket created to connect to www.externalsite.com
[Thu Apr 11 07:47:35 2013] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  : proxy: HTTP: attempt to connect to internal.proxy.ip.addy:8080 (www.externalsite.com) failed

代理服务器日志中未记录任何内容,而且我知道如果在浏览器中显式设置代理服务器并加载该externalsite.com,则代理服务器将正常工作

有什么想法吗?

当连接到代理时最终成为vmware IP地址问题...上述指令似乎确实可以正确地将apache代理传递到代理服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM