javascript Nginx配置iconfont字体支持跨域#nginx

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Nginx配置iconfont字体支持跨域#nginx相关的知识,希望对你有一定的参考价值。

server {
    root /webserver;

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

server {
    root /webserver;

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

以上是关于javascript Nginx配置iconfont字体支持跨域#nginx的主要内容,如果未能解决你的问题,请参考以下文章