【问题标题】:Uploads with nginx, Unicorn, Rails 4 and CarrierWave fail使用 nginx、Unicorn、Rails 4 和 CarrierWave 上传失败
【发布时间】:2014-09-25 03:32:01
【问题描述】:

我正在开发一个应用程序,用户可以在某个时候上传 1-3 张图片。但是,这不起作用。提交表单时,Unicorn 不会收到任何信息。我只有一条来自 nginx 的日志信息:

2014/09/24 15:28:05 [error] 7301#0: *23953 readv() failed (104: Connection reset by peer) while reading upstream, client: <my IP>, server: localhost, request: "POST /products HTTP/1.1", upstream: "http://unix:/tmp/<appname>/unicorn.sock:/products", host: "<domain>", referrer: "<domain>/products/new"

另外,我的浏览器会尝试加载页面一段时间,然后显示一个空白页面,响应标题为 500。

编辑:好吧,看起来,机架在处理文件上传时会导致崩溃:

E, [2014-09-24T21:22:33.505511 #18252] ERROR -- : app error: invalid byte sequence in UTF-8 (ArgumentError)
E, [2014-09-24T21:22:33.506288 #18252] ERROR -- : kernel/common/string.rb:103:in `=~'
E, [2014-09-24T21:22:33.506392 #18252] ERROR -- : /srv/<appname>/.rvm/gems/rbx-2.2.10/gems/rack-1.5.2/lib/rack/multipart/parser.rb:92:in 'get_current_head_and_filename_and_content_type_and_name_and_body'

【问题讨论】:

    标签: ruby-on-rails nginx carrierwave unicorn


    【解决方案1】:

    在 unicorn.rb 中检查你的独角兽配置并尝试修改超时

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-05
      • 2016-12-22
      • 2013-02-24
      • 2017-03-02
      • 2015-07-05
      • 2013-11-20
      相关资源
      最近更新 更多