Rails ajax 文件上传和 nginx
我使用 Rails 和 valums file-uploader 进行 ajax 上传。在开发过程中,一切都完美无缺,但是在 linode 的生产过程中,nginx 却出现了问题。 错误日志:
[ pid=2097 thr=3065629552 file=ext/nginx/HelperAgent.cpp:584 time=2011-06-23 09:47:06.714 ]: Uncaught exception in PassengerServer client thread: exception: An error occured while sending the request body to the request handler: Broken pipe (32) backtrace:
in 'virtual void Passenger::Session::sendBodyBlock(const char*, unsigned int)' (Session.h:198)
in 'void Client::sendRequestBody(Passenger::SessionPtr&, Passenger::FileDescriptor&, const std::string&, long unsigned int)' (HelperAgent.cpp:295)
in 'void Client::handleRequest(Passenger::FileDescriptor&)' (HelperAgent.cpp:510)
in 'void Client::threadMain()' (HelperAgent.cpp:603)
2011/06/23 09:47:06 [error] 2134#0:
*13 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 94.76.87.38, server:
69.168.213.69, re$
使用 Rails 3 和回形针,上传在没有 JavaScript 的情况下工作正常。数据库 - PostgreSQL。 我对服务器端的东西真的很了解,并寻求帮助如何解决这个问题。如果您需要更多信息,请发表评论。
I'm using Rails and valums file-uploader for ajax upload. In development all works flawlessly, however in production on linode nginx breaks things.
Error log:
[ pid=2097 thr=3065629552 file=ext/nginx/HelperAgent.cpp:584 time=2011-06-23 09:47:06.714 ]: Uncaught exception in PassengerServer client thread: exception: An error occured while sending the request body to the request handler: Broken pipe (32) backtrace:
in 'virtual void Passenger::Session::sendBodyBlock(const char*, unsigned int)' (Session.h:198)
in 'void Client::sendRequestBody(Passenger::SessionPtr&, Passenger::FileDescriptor&, const std::string&, long unsigned int)' (HelperAgent.cpp:295)
in 'void Client::handleRequest(Passenger::FileDescriptor&)' (HelperAgent.cpp:510)
in 'void Client::threadMain()' (HelperAgent.cpp:603)
2011/06/23 09:47:06 [error] 2134#0:
*13 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 94.76.87.38, server:
69.168.213.69, re$
Upload is working fine without javascript, using rails 3 and paperclip. Database - PostgreSQL.
I'm really low at server-side stuff and looking help how to fix that. If you need additional information please leave a comment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文件上传在 webbrick 上通过
StringIO
进行,但在除 webrick 之外的所有平台上都通过Rack
进行。这些更改为我解决了一个问题:File upload works through
StringIO
on webbrick, but throughRack
on everything but webrick. Those changes fixed an issue for me: