The proxy server received an invalid response from an upstream server.

本文介绍了一个关于Apache作为代理服务器时出现的错误:“The proxy server received an invalid response from an upstream server”,并提供了有效的解决方法,包括如何调整Apache配置来避免此类问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

调试程序的时候,网页上报这个错误,后台也是错误。重启一下程序后,去掉所有断点,程序正常:我猜测我的异常原因是:调试时间过长,超过Apache服务器等待时间,故保存。

网上搜了一下该问题的解决方案:加长长时间请求,可以看出我上面的猜测是正确的。

附网上的解决方法:http://blog.163.com/fumei2010@126/blog/static/13284928620125110144180/

apache 做代理 报如下错误:The proxy server received an invalid response from an upstream server. 

网站配置是apache+tomcat,tomcat没有报错,apache报错是:

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

编辑 httpd.conf增加这两行:

SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1

之后重启下 apache 服务

转载于:https://www.cnblogs.com/xxchao/p/3979658.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值