我正在尝试在 Spree 3.1.0 + Passenger 5.0.30 + Nginx + Capistrano 3.5 + Digital Ocean 上加载图片,我已关注here和{{3}但此刻没有运气。
很奇怪......正在加载我的css文件但没有加载我的图像背景
我的 / etc / nginx / sites-available / default 文件:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name rodeobest.com;
passenger_enabled on;
rails_env production;
root /home/deployer/RMG_rodeobest/current/public;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# if the request is for a static resource, nginx should serve it dir$
# and add a far future expires header to it, making the browser
# cache the resource and navigate faster over the website
location ~ ^/(spree|system|assets)/ {
root /home/deployer/RMG_rodeobest/current/public;
expires max;
break;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
root /home/deployer/RMG_rodeobest/current/public;
}
}
正如文档所述,我已将location ~ ^/(system|assets)/
更改为location ~ ^/(spree|system|assets)/
并重新启动服务器,但正如我所说,没有运气。任何的想法?提前谢谢
参考文献: