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

编程技术  /  houtizong 发布于 3年前   184

网站配置是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 服务

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客