0

I am using Dragonfly with Nginx, unicorn and mini_magick. I am using mem_cache_store in production.

Image upload and display works fine in development environment. But on production it fails with internal server error 500. I cannot see any logs on my production log, but it fails on production.

I get error for URLs of following type. http://cdn.mydomain.com/media/BAhbB1sHOgZmSSIoMTAvcHJvZHVjdHMvMjUvR3JvdW5kJTIwbnV0XzQwOS5qcGcGOgZFVFsIOgZwOgp0aHVtYkkiCjUweDUwBjsGVA.jpg

Error code is 500

I ve been searching all the documentation which comes along with the gem. I can see the following middleware on top of the middleware stack in production as well:

use Rack::Cache
use Dragonfly::CookieMonster
use Dragonfly::Middleware

I could not get much help from forums - though there is a similar bug posted 2 years ago and is supposed to be fixed. And fixes there also did not help.

Please help to fix this. Any direction as to how I can debug this would also help.

4

2 回答 2

1

我遇到了这样的问题,结果发现问题是我没有在生产中安装 imagemagick。这篇文章帮助了我Dragonfly - 上传的图片未显示

顺便说一句,我也没有看到任何日志。

于 2013-11-09T18:28:38.197 回答
0

您需要添加:

Config.middleware.insert 0, Rack::Sendfile, config.action_dispatch.x_sendfile_header

这样 sendfile 在 rack:cache 之前,它应该可以工作。

于 2013-07-31T03:07:43.527 回答