首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何修复apache2 "proxy_http:error“AH01102:从远程服务器本地主机读取状态行时出错:4382

如何修复apache2 "proxy_http:error“AH01102:从远程服务器本地主机读取状态行时出错:4382
EN

Server Fault用户
提问于 2020-04-28 06:31:50
回答 1查看 45.4K关注 0票数 5

如何修复apache2 "proxy_http:error“AH01102:从远程服务器本地主机读取状态行时出错:4382。

我有一个apache2 few服务器,用于在后端提供少量nodejs应用程序。

Apache2 2019服务器版本:服务器版本:Apache2.4.41 (Ubuntu)服务器构建: 2019-08-21T20:43:05

Nodejs版本: v10.18.1

Mongo db版本: v4.0.15

下面的错误/错误(请参阅日志)困扰着我们所有后端应用程序"proxy_http:error“AH01102:从远程服务器本地主机读取状态行:4382。

代码语言:javascript
运行
复制
[Mon Apr 27 20:09:05.697271 2020] [proxy_http:error] [pid 26792:tid 140063099688704] (70007)The timeout specified has expired: [client 178.153.198.97:52385] AH01095: prefetch request body failed to 127.0.0.1:4381 (localhost) from 178.153.198.97 (), referer: https://www.example.com/sub-admin/menus/add-menu
[Mon Apr 27 20:21:51.617095 2020] [proxy_http:error] [pid 26764:tid 140062901626624] (104)Connection reset by peer: [client 178.153.195.206:61268] AH01102: error reading status line from remote server localhost:4382, referer: http://www.example.com/restaurant/dashboard
[Mon Apr 27 20:21:51.617117 2020] [proxy:error] [pid 26764:tid 140062901626624] [client 178.153.195.206:61268] AH00898: Error reading from remote server returned by /restaurant/assets/img/avatars/5.jpg, referer: http://www.example.com/restaurant/dashboard
[Tue Apr 28 03:51:28.498423 2020] [proxy_http:error] [pid 26793:tid 140062868055808] (104)Connection reset by peer: [client 89.211.117.185:57622] AH01102: error reading status line from remote server localhost:4382, referer: http://www.example.com/restaurant/dashboard
[Tue Apr 28 03:51:28.498455 2020] [proxy:error] [pid 26793:tid 140062868055808] [client 89.211.117.185:57622] AH00898: Error reading from remote server returned by /restaurant/static/css/main.f8d32764.chunk.css, referer: http://www.example.com/restaurant/dashboard

到目前为止,我已经尝试了这些东西来修正这个错误。

  1. ProxyPreserveHost On -它没有锻炼.
  2. disablereuse=on。它没有起作用。
  3. Timeout=600,然后Timeout=900。没起作用。
  4. retry=1 acquire=3000 timeout=600 Keepalive=On.没起作用。
  5. SetEnv强制-代理-请求-1.0 1 SetEnv代理-no备活1

工作时间较短(12小时)。同样的,同样的错误也以与之前几乎相同的频率重复出现。

  1. SetEnv代理-初始-非池的1 SetEnv代理-no备活1

这个工作了24小时。24小时后,这个错误再次出现。虽然这一次在24小时后,错误只发生在一小时一次,有时只有两小时一次,有时在两五个小时内发生一次。

1Q.首先,这个错误发生的原因。

2Q.此错误是否仅由于apache或nodejs应用程序也可能是罪魁祸首而发生?

代码语言:javascript
运行
复制
 (But there's hardly any error logs of the application, when this apache error occurs).

3Q.如何/什么是识别、诊断和解决这一错误的最佳途径,因为在各种论坛上搜索之后,似乎没有人完美地解决这一错误,或对其有一个正确的答案,这是自2006年以来的情况,对一些论坛进行了研究。

这是我的apache配置文件

代码语言:javascript
运行
复制
<VirtualHost *:443>
  ServerAdmin root@example.com
  ServerName  www.example.com
  ServerAlias example.com

  SSLEngine On
  SSLProxyEngine On
  SSLCertificateFile "/etc/ssl/private/server.crt"
  SSLCertificateKeyFile "/etc/ssl/private/server.key"


  ProxyRequests Off

    #Admin
    ProxyPass /admin http://localhost:4380/
    ProxyPassReverse /admin http://localhost:4380/
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1


    ProxyPass /restaurant http://localhost:4382/
    ProxyPassReverse /restaurant http://localhost:4382/
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1


    ProxyPass /sub-admin http://localhost:4385/
    ProxyPassReverse /sub-admin http://localhost:4385/
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1


    #API
    ProxyPass /admin-api/ http://localhost:4381/
    ProxyPassReverse /admin-api/ http://localhost:4381/
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1


    ProxyPass /restaurant-api/ http://localhost:4379/
    ProxyPassReverse /restaurant-api/ http://localhost:4379/
    SetEnv proxy-nokeepalive 1
    SetEnv proxy-initial-not-pooled 1


</VirtualHost>
EN

回答 1

Server Fault用户

发布于 2020-06-17 09:39:11

如果您查看您的日志,首先会出现(70007)指定的超时:客户178.153.198.97:52385 AH01095日志的其余部分就是其中的一种结果。

这里发生的情况是,您的本地主机实现需要很长时间才能返回答案。也许您可以在您的实现中验证为什么是这样,并尝试优化它。但是在apache中,您可以定义哪个是等待本地实现的连接时间和超时时间。

ProxyPass /restaurant http://localhost:4382/ connectiontimeout=以秒为单位的时间 timeout=[秒计]

例如60秒(1分钟)

ProxyPass /restaurant http://localhost:4382/ connectiontimeout=60 timeout=60

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1014537

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档