Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2505743
  • 博文数量: 709
  • 博客积分: 12251
  • 博客等级: 上将
  • 技术积分: 7905
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-17 00:00
个人简介

实现有价值的IT服务

文章存档

2012年(7)

2011年(147)

2009年(3)

2008年(5)

2007年(74)

2006年(431)

2005年(42)

分类: 系统运维

2006-02-09 17:10:58

关于apache模块mod_proxy中的ProxyPass和ProxyPassReverse的使用问题    对应详细使用说明如下:
/usr/local/apache2/bin/apxs -c -i -a  /usr/local/httpd-2.0.54/modules/proxy/mod_proxy.c
(一).ProxyPass 指令说明: 将一个远端服务器映射到本地服务器的URL空间中
语法: ProxyPass [路径] !|url 上下文:
服务器配置, 虚拟主机
状态: Extension
模块: mod_proxy
指令对于您不想对某个子目录进行反向代理时很有用。
比如说:ProxyPass /mirror/foo/i !ProxyPass /mirror/foo
将会代理除对/mirror/foo/i请求之外的所有对foo.com的/mirror/foo请求。
注意:顺序很重要,您需要把特例情况放在一般代理通过指令当在配置段中使用时,
第一个参数会被忽略而是采用由指令指定的本地目录。
如果您需要一个更加灵活的反向代理配置,请参见使用[P]标记的RewriteRule指令。
(二).ProxyPassReverse 指令说明: 调整由反向代理服务器发送的HTTP回应头中的URL
语法: ProxyPassReverse [路径]
url 上下文: 服务器配置, 虚拟主机
状态: Extension
模块: mod_proxy 此指令使 Apache
调整HTTP重定向回应中Location, Content-Location和URI头里的URL。
HTTP redirect responses.
This is essential when Apache is used as a reverse proxy to avoid by-passing the reverse proxy
because of HTTP redirects on the backend servers
which stay behind the reverse proxy.路径是本地虚拟路径的名称。
url远端服务器的部分URL。与ProxyPass指令中的使用方法相同。
示例:假定本地服务器拥有地址;
那么ProxyPass /mirror/foo/ /mirror/foo/
will not only cause a local request for the <> to be internally
converted into a proxy request to <> (the functionality ProxyPass provides here).
It also takes care of redirects the server foo.com sends: when is redirected by him to Apache adjusts this to before forwarding the HTTP redirect response to the client. Note that the hostname used for constructing the URL is chosen in respect to the setting of the UseCanonicalName directive.Note that this ProxyPassReverse directive can also be used in conjunction with the proxy pass-through feature ("RewriteRule ... [P]") from mod_rewrite because its doesn't depend on a corresponding ProxyPass directive.When used inside a section, the first argument is ommitted and the local directory is obtained from the .
(三).实际问题解决及说明:

ProxyPass /mysys/      
ProxyPassReverse /mysys/

①  这里有两个mysys,我们分别叫做叫做path_wapm和path_iisProxyPass /path_wapm/            path_wapm:这个是虚拟的目录名称,可以任意指定一个
②ProxyPassReverse /path_wapm/           path_iis:这个必须通过81端口可以访问的 那么,访问服务器/path_wapm的时候,实际访问的将自动转换为了的.
③path_wapm如果不加,就不知道访问哪一个虚拟目录的时候需要使用ASP,path_iis不加,那么就是访问的效果了 简单来说:就是把IIS站点的一个目录,当作WAPM的一个虚拟目录来访问,可以是IIS站点的一个子目录,也可以是根目录. (四).如果还有不明白的地方,请到>查对!
阅读(3780) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~