woff

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

星期三, 八月 7th, 2019 | html5, JAVA-and-J2EE | 没有评论

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: ,

Search

文章分类

Links

Meta