详情如下:
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
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>