Apache、Nginx下Font Awesome等woff的文件得显示问题

星期三, 2019-08-07 | Author: Lee | html5, JAVA-and-J2EE | 3,409 views

1.Apache 下配置新增

ddType application/font-sfnt otf ttf
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType application/vnd.ms-fontobject eot
 
<FilesMatch "\.(ttf|otf|eot|woff|woff2)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

2.nginx 配置新增

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

Tags: ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1901.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta