Ruby on rails Rails Nginx不会加载字体

Ruby on rails Rails Nginx不会加载字体,ruby-on-rails,nginx,fonts,Ruby On Rails,Nginx,Fonts,我已经预编译了我的资源,除了ttf文件的字体外,所有资源都在加载。这些资产还具有ttf.gz文件。我已经查过名字了,确定是同一个名字。此外,我的静态图像加载刚刚好 我的nginx配置如下所示 server { listen 80; root /home/usr/apps/web/public; location / { proxy_pass http://app; proxy_set_header X-Forwar

我已经预编译了我的资源,除了ttf文件的字体外,所有资源都在加载。这些资产还具有ttf.gz文件。我已经查过名字了,确定是同一个名字。此外,我的静态图像加载刚刚好

我的nginx配置如下所示

server {
     listen 80;

     root /home/usr/apps/web/public;

     location / {
            proxy_pass http://app;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;
    }

    location ~* ^/assets/ {
            gzip_static on;
            expires 1y;
            add_header Cache-Control public;

            location ~* \.(eot|otf|ttf|woff|woff2)$ {
                    add_header Access-Control-Allow-Origin *;
            }

    }

     error_page 500 502 503 504 /500.html;
     client_max_body_size 4G;
     keepalive_timeout 10;

}
这就是控制台显示的内容

Failed to load resource: the server responded with a status of 404 (Not Found)

我刚修好。看起来问题出在预编译上。获取字体时,我的字体sass没有正确配置。

我刚刚修复了它。看起来问题出在预编译上。获取我的字体时未正确配置我的字体sass。

什么是“预编译问题”?我现在也遇到了同样的问题,但还没有找到解决办法。你说的“预编译问题”是什么意思?我现在面临同样的问题,但还没有找到解决办法