对一张特定图像的请求以 502 bad gateway and proxy 错误结束

发布于 2024-08-28 18:51:52 字数 1095 浏览 7 评论 0原文

我在 Windows 虚拟服务器上运行基于 Ruby on Rails 的应用程序 Redmine(基于 BitNami redmine 包)。它运行 Apache、Mongrel、Ruby 和 Rails。

当我在一个 HTML 页面中构建模板时,我请求一个名为 /templates/mytemplate/images/bkg.jpg 的静态图像资源 - 大约 15 KB 大 - 我得到一个 502关于三分之二的请求的错误网关错误。 x

alt文本
(来源:pekkagaiser.com

Apache的错误然后 log 包含

on Apr 12 22:50:33 2010] [error] (620018)APR does not understand this error code:
proxy: pass request body failed to 127.0.0.1:3001 (127.0.0.1)

[Mon Apr 12 22:50:33 2010] [error] proxy: pass request body failed to 127.0.0.1:3001
(127.0.0.1) from 78.34.240.113 ()

It's only for that one resources.其他更大的图像和 CSS 样式表每次都能毫无问题地加载。

奇怪的是,只有当图像用作 CSS 样式表中的背景图像时才会发生这种情况。即使缓存关闭,在浏览器中重复直接访问图像也可以正常工作。这可能是引用者问题吗?但我看不出如何。

我对 Ruby 和 Rails 知之甚少。谁能告诉我这可能是什么以及我应该看哪里?

更新:再想一想,这可能属于服务器故障。如果你也有同样的想法,请移走。

I have the Ruby on Rails-based application Redmine (based on the BitNami redmine package) running on a Windows virtual server. It runs Apache, Mongrel, Ruby, and rails.

When, in a HTML page I am building a template for, I request a static image resource named /templates/mytemplate/images/bkg.jpg - around 15 kilobytes big - I get a 502 Bad gateway error about two out of three requests. x

alt text
(source: pekkagaiser.com)

Apache's error log then contains

on Apr 12 22:50:33 2010] [error] (620018)APR does not understand this error code:
proxy: pass request body failed to 127.0.0.1:3001 (127.0.0.1)

[Mon Apr 12 22:50:33 2010] [error] proxy: pass request body failed to 127.0.0.1:3001
(127.0.0.1) from 78.34.240.113 ()

It's only for that one resource. Other, much larger images and CSS style sheets get loaded every time without problems.

Oddly, this will happen only if the image is used as a background image in a CSS style sheet. Repeated direct access tol the image in the browser works fine, even with the cache turned off. Could this be a referer problem? But I can't see how.

I know very little about Ruby nor Rails. Can anybody tell me what this could be and where I should look?

Update: On second thought, this might belong on serverfault. Migrate away if you think the same.

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

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

发布评论

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

评论(1

森林很绿却致人迷途 2024-09-04 18:51:52

我重新安装了 Rails,问题就解决了。

I reinstalled Rails and that sorted it out.

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