文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Apache Proxy 的特别参数

Apache Proxy 的特别参数

时间:2010-11-03  来源:xing_jia

1.SetEnv force-proxy-request-1.0 1 2.SetEnv proxy-nokeepalive 1   不加这两个选项,可能会导致ie5.5等浏览器访问异常,时好时坏。出现以下提示:   Http 502 Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
  引用
For circumstances where mod_proxy is sending requests to an origin server that
 doesn't properly implement keepalives or HTTP/1.1, there are two environment variables that can force the request to use HTTP/1.0 with no keepalive. These are set via the SetEnv directive. These are the force-proxy -request-1.0 and proxy -nokeepalive notes.
大概是这意思(不是我译的):
当mod_proxy向一个没有正确实现持久连接(KeepAlive)或HTTP/1.1的原始服务器发送请求的时候,可以通
过设置两个环境变量来发送不带持久连接(KeepAlive)的HTTP/1.0请求。这两个变量是通过SetEnv指令设 置的。
以下是force-proxy-request-1.0和proxy -nokeepalive的例子:
<VirtualHost *: 80 >   
   JkMount /hr/servlet/* worker1   
   JkMount /hr/*.jsp worker1   
   JkMount /hr/*. do  worker1   
   ServerAdmin njgnini @163 .com   
   ServerName www.test.com
   ServerAlias www.test.com.cn  
   RewriteEngine On   
   RewriteRule ^/$ /hr/ [R,P]         
     
   SetEnv force-proxy-request-1.0 . 1    
   SetEnv proxy-nokeepalive  1    
</VirtualHost>  
配置好以后需要重启apache生效   参考: http://httpd.apache.org/docs/2.3/mod/mod_proxy.html   =============================================================

ProxyPass、 ProxyPassReverse

    这两个配置时,如果不加ProxyPassReverse 这行,则IE地址栏里面显示就是Apache代理后端应

用服务器(比如tomcat)所对就的地址,反之,加上ProxyPassReverse这行,则显示的就是

Apache的地址,把原tomcat给隐藏了

====================================================
相关阅读 更多 +
排行榜 更多 +
突围血战 v5.0.0 安卓版

突围血战 v5.0.0 安卓版

休闲益智 下载
无限都市乱斗 v2.0.3 安卓版

无限都市乱斗 v2.0.3 安卓版

飞行射击 下载
无限都市乱斗 v2.0.3 安卓版

无限都市乱斗 v2.0.3 安卓版

飞行射击 下载