【问题标题】:Problem downloading large files with Rails, Nginx (with x-accel-redirect) and Apache(x-sendfile)使用 Rails、Nginx(使用 x-accel-redirect)和 Apache(x-sendfile)下载大文件时出现问题
【发布时间】:2011-01-06 18:20:55
【问题描述】:

当大小超过 1gb 时,我们会遇到下载问题。

我们在 Amazon EC2 2gb 上使用 Rails 2.3.5、passenger 2.2.9 和 2gb Ram 和 Fedora 10。

文件存储在/mnt/files,项目在/mnt/www/project

我们尝试使用 Nginx 和 x-accel-redirect 以及 Apache 使用 x-sendfile 发送文件。

我们只能下载并且总是1.09gb而不是1.54gb!!

我们可以毫无问题地下载小于1gb

的文件

如果我们在rails public dir中链接相同的文件(没有损坏),我们可以毫无问题地下载。

X-Accel-Redirect 或 X-SendFile 配置正确,经过大量测试和检查。

所以:

  1. 带有 x-accel-redirect 的 Nginx [失败]
  2. Apache 与 x-send-file [失败]
  3. 在 nginx 或 apache 上发送不带 x-accel-redirect 或 x-sendfile 的文件 [fail]
  4. 公开链接文件并直接下载 [works]

有什么建议吗?

谢谢!!!

【问题讨论】:

    标签: ruby-on-rails apache nginx x-sendfile


    【解决方案1】:

    如果您希望限制对这些下载的访问,您是否尝试过Access Key module

    【讨论】:

      猜你喜欢
      • 2021-12-24
      • 2013-04-17
      • 2011-04-30
      • 2018-02-02
      • 1970-01-01
      • 2012-10-09
      • 2015-04-29
      • 1970-01-01
      相关资源
      最近更新 更多