带有大量 POST 上传和我的 apache 的坏网关 +清漆 +克隆设置

发布于 2024-12-28 08:49:36 字数 654 浏览 1 评论 0原文

这是一个相当复杂的场景,因此我非常感谢任何指向正确方向的指针。

所以我在服务器 A 上设置了 apache 来代理服务器 B 的 https 流量,这是一个 varnish 和 apache 背后的克隆站点。

我连接到 A 并且可以在 https 上浏览该网站,一切都很好。然而,当我通过 plone 的 POST 表单上传文件时,问题就开始了。我可以上传小文件(~1 MB),但是当我尝试上传 50MB 文件时,我一直等待文件上传,当指示为 100% 时,我得到一个错误的网关(代理服务器收到来自上游服务器的无效响应。)

在我看来,A 和 B 的通信之间出现了超时,并且没有被重定向到正确的 url,而是收到了错误的网关,更不用说文件未上传。

在 apache 日志上,我看到

[error] proxy: pass request body failed

正如其他线程上的建议,我尝试了以下值,但没有运气

force-proxy-request-1.0
proxy-nokeepalive
KeepAlive 
KeepAliveTimeout 
proxy-initial-not-pooled
Timeout 
ProxyTimeout 

Sooooo..有什么建议吗?提前一百万致谢!

This is a rather complicated scenario, so I would highly appreciate any pointer to the correct direction.

So I have setup apache on server A to proxy https traffic το server B, that is a plone site behind varnish and apache.

I connect to A and can browse the site on https, everything is fine. However, problems start when I upload files, via plone's POST forms. I can upload small files (~1 MB), but when I try to upload a 50MB file, I wait all the time till the file is uploaded, and when the indication is 100%, I get a Bad gateway (The proxy server received an invalid response from an upstream server.)

It seems to me that something timeouts between the communication of A and B and instead of being redirected to the correct url, I get a Bad gateway, not to mention that the file is not uploaded.

On the apache log I see

[error] proxy: pass request body failed

As suggested on other threads, I've experimented with the following values with no luck

force-proxy-request-1.0
proxy-nokeepalive
KeepAlive 
KeepAliveTimeout 
proxy-initial-not-pooled
Timeout 
ProxyTimeout 

Sooooo..any suggestions? Thanks a million in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人的歌 2025-01-04 08:49:36

你检查过清漆配置吗? varnish 有自己的一些超时,我熟悉 send_timeout ,如果在几秒钟内无法完成,它通常会中断下载(varnish 对于大型下载确实没有任何好处,因为你最终会做一些愚蠢的事情,例如配置 send_timeout=7200 来使其发挥作用)。

另外,为该后端将first_byte_timeout设置为更大的数字,因为大文件上传可能会延迟plone的响应,足以导致这种情况。

Did you check the varnish configuration? varnish has some timeouts of its own, I am familiar with send_timeout which usually breaks downloads if they fail to finish within a few seconds (Varnish really isn't any good for large downloads, because you end doing stupid things like configuring send_timeout=7200 to make it work).

Also, set first_byte_timeout to a larger number for that backend, because a large file upload might delay plone's response just enough to cause this.

迷爱 2025-01-04 08:49:36

在 apache 虚拟主机文件中设置 Timeout 和 KeepAliveTimeout 对我有用。

例子:

Timeout 3600
KeepAliveTimeout 50

Setting the Timeout and KeepAliveTimeout in the apache virtual host file worked for me.

Example:

Timeout 3600
KeepAliveTimeout 50
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文