Theproxyserverreceivedaninvalidresponsefroman。。。
调试程序的时候,⽹页上报这个错误,后台也是错误。重启⼀下程序后,去掉所有断点,程序正常:我猜测我的异常原因是:调试时间过长,超过Apache服务器等待时间,故保存。
⽹上搜了⼀下该问题的解决⽅案:加长长时间请求,可以看出我上⾯的猜测是正确的。
apache 做代理报如下错误:The proxy server received an invalid response from an upstream server.
⽹站配置是apache+tomcat,tomcat没有报错,apache报错是:
invalids
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 us
e 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的例⼦:
编辑 f增加这两⾏:
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
之后重启下 apache 服务

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。