|
这两天访问ourdev有时候很慢,不时还会出现错误,相信大家都遇到了吧:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /bbs/bbs_list.jsp
Reason: Error reading from remote server
查了下apache的文档:
应该是Apache和Proxy_mod的BUG:
------- Additional Comments From [EMAIL PROTECTED] 2006-07-05 16:05 -------
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,追加两行配置:
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
虚拟主机的设置方式:
<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, 正常!
-------------------------------------------------------------------------
apache文档:http://httpd.apache.org/docs/2.3/mod/mod_proxy.html
当mod_proxy向一个没有正确实现持久连接(KeepAlive)或HTTP/1.1的原始服务器发送请求的时候,可以通过设置两个环境变量来发送不带持久连接(KeepAlive)的HTTP/1.0请求。这两个变量是通过SetEnv指令设置的。
以下是force-proxy-request-1.0和proxy-nokeepalive的例子:
<Location /buggyappserver/>
ProxyPass http://buggyappserver:7001/foo/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
如果为虚拟主机可在httpd.conf的VirtualHost里追加上面两行设置:
<VirtualHost *:80>
..................
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
</VirtualHost>
-----------------------------------------------------------
阿莫试试吧 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|