Apache22 的Http代理出错 Proxy Error !

来源:互联网 发布:mysql date add的用法 编辑:程序博客网 时间:2024/06/05 17:02
 

详情如下:

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: DNS lookup failure for: localhost

google给的解决办法:

With the following 'Murxaround' it's working now:
- Added 'keeplive Off' in httpd.conf  -> No effect
- Set keep-alive timeout to 1 day in IIS -> No effect
- Added
'SetEnv force-proxy-request-1.0 1'
'SetEnv proxy-nokeepalive 1'
in httpd.conf
It's working now without errors since 30 hours...
Don't know if first steps were necessary, I let them in place

 

于是,.修改 httpd.conf
 

<VirtualHost  *:80>
        ServerAdmin 
asion@mail.com
        ServerName www.domain.com
        ProxyPass / http://192.168.0.92
        ProxyPassReverse  / http://192.168.0.92
        SetEnv force-proxy-request-1.0.1
        SetEnv proxy-nokeepalive 1
</virtualHost>

然后重启Apache, 刷新了N次,正常!!

【后话: 】转贴APACHE官方中文说明,关于协议调整
mod_proxy向一个没有正确实现持久连接(KeepAlive)或HTTP/1.1的原始服务器发送请求的时候,可以通过设置两个环境变量来发送不带持久连接(KeepAlive)的HTTP/1.0请求。这两个变量是通过SetEnv指令设置的。

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

原创粉丝点击