Rails + Dragonfly + Nginx - 错误的图像根路径

时间:2015-05-21 19:13:47

标签: ruby-on-rails nginx amazon-s3 dragonfly-gem

我有使用

的Rails应用
 gem 'dragonfly-s3_data_store', '~> 1.0.0'

并将资产上传到S3。

文件上传得很好,但随后又无法显示。如果我查看日志,我会看到:

 *150 open() "/etc/nginx/html/system/images/W1siZiIsIjIwMTUvMDUvMjEvMTgvNDIvNTUvOTEwL3ByZXNzX3Nob3J0LnBuZyJdXQ/press_short.png" failed (2: No such file or directory), client: 173.225.73.29, server: SERVERNAME, request: "GET /system/images/W1siZiIsIjIwMTUvMDUvMjEvMTgvNDIvNTUvOTEwL3ByZXNzX3Nob3J0LnBuZyJdXQ/press_short.png?sha=b4bb5663e1358837 HTTP/1.1", host: "EC2-ADDDRESS", referrer: "http://ec2-XXXX.compute-1.amazonaws.com/"

1 个答案:

答案 0 :(得分:0)

对于那些可能遇到类似问题的人。它全部与" verify_urls"相关联。在蜻蜓。

您可以在此主题中找到更多答案:

https://github.com/refinery/refinerycms/issues/2681

基本上你需要为Dragonfly添加秘密或关闭verify_urls(由于漏洞而不推荐)。