欢迎来到cool的博客
7

Music box

Click to Start

点击头像播放音乐
新博客链接

服务器上,rails项目找不到public,assets,uploads等文件时,配置一下nginx即可

进入项目的nginx.cof文件(添加代码):

location ~ ^/assets/ {
    root /var/data/cms/current/public;
    expires 1y;
    add_header Cache-Control public;
    add_header ETag "";
    break;
  }
  location ~ ^/uploads/ {
    root /var/data/cms/current/public;
    expires 1y;
    add_header Cache-Control public;
    add_header ETag "";
    break;
  }

重启ngiinx,即可。

返回列表