Apache 中的间歇性代理错误:“部分结果有效,但处理不完整”,并显示“AH01110:读取响应时出错”

Wac*_*Get 5 proxy varnish reverse-proxy mod-proxy apache-2.4

我在 CentOS 7.8 上使用 Apache 2.4.43 以及 Varnish 6 和 PHP-FPM 来为 Magento 2 网站提供服务。

Varnish 侦听端口 80。Apache 侦听 8080 以向 Varnish 提供内容,并且还侦听端口 443,该端口将 HTTPS 请求代理到 Varnish,如下所示:

ProxyPreserveHost On
ProxyPass         / http://127.0.0.1:80/
RequestHeader     set X-Forwarded-Port  "443"
RequestHeader     set X-Forwarded-Proto "https"
Run Code Online (Sandbox Code Playgroud)

这适用于大多数请求,但偶尔(约 10% 的请求)我会收到来自 Varnish 和 Apache 的 503 响应。我在 Apache 日志中看到的唯一错误是:

[proxy_http:error] [pid 6719:tid 140054596265728] (70008)Partial results are valid but processing is incomplete: [client x.x.x.x:53760] AH01110: error reading response, referer: http://example.com
Run Code Online (Sandbox Code Playgroud)

如果我重试该请求,它通常会立即起作用,尽管有时我必须刷新几次才能满足请求。我注意到,当发出大批量请求时(即包含数百个外部资源的页面),这种情况会更频繁地发生。我还注意到,这种情况似乎发生在较大的文件上,而不是较小的文件上。

我猜测这可能是某种超时,但我不确定要调整哪些值或如何进一步调试它。

我尝试过的事情包括以下内容:

  • 这个答案涉及更改我不使用的模块(Forge Rock OpenAm)。
  • 这个建议禁用mod_reqtimeout我尝试过的方法,但没有帮助。
  • 我尝试过使用KeepAlive Off它没有帮助。
  • 我尝试将其放在retry=0末尾ProxyPass,显然应该允许失败的代理连接立即重试,但这没有帮助

任何帮助深表感谢。