apache proxy error 502错误解决办法

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的例子:

Java代码  收藏代码

    <Location /buggyappserver/> 
      ProxyPass http://buggyappserver:7001/foo/ 
      SetEnv force-proxy-request-1.0 1 
      SetEnv proxy-nokeepalive 1 
    </Location>  


最后在我的httpd.conf的VirtualHost里加上了上面的两行设置
Java代码  收藏代码

    <VirtualHost *:80>  
       JkMount /hr/servlet/* worker1  
       JkMount /hr/*.jsp worker1  
       JkMount /hr/*.do worker1  
       ServerAdmin [email protected]  
       ServerName www.iteye.com  
       ServerAlias www.iteye.com.cn  
       RewriteEngine On  
       RewriteRule ^/$ /hr/ [R,P]        
        
       SetEnv force-proxy-request-1.0.1  
       SetEnv proxy-nokeepalive 1  
    </VirtualHost>

猜你喜欢

转载自seasoft.iteye.com/blog/2095223
今日推荐