1、Nginx配置字体

mime.types文件

application/font-sfnt otf ttf;

application/font-woff woff;

application/font-woff2 woff2;

application/vnd.ms-fontobject eot;

nginx.conf文件

location ~* \.(eot|otf|ttf|woff|woff2)$ {

add_header Access-Control-Allow-Origin *;

}

2、Apache配置字体

mime-type文件

AddType application/font-sfnt otf ttf

AddType application/font-woff woff

AddType application/font-woff2 woff2

AddType application/vnd.ms-fontobject eot

*.htaccess文件

<FilesMatch “.(eot|ttf|otf|woff|woff2)”>

Header set Access-Control-Allow-Origin “*”

</FilesMatch>

发表评论

邮箱地址不会被公开。 必填项已用*标注