Font-Awesome错误404字体 [英] Font-Awesome error 404 on fonts

查看:670
本文介绍了Font-Awesome错误404字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道发生了什么,但在浏览器控制台中,我可以看到与font-awesome相关的3个错误

  GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff2?v=4.3.0 
GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff ?v = 4.3.0
GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.ttf?v=4.3.0

我知道这是可笑的我不能自己弄清楚这一点,但一切似乎是好的,在我的index.html我有这样的

 < link rel =stylesheethref =bower_components / font-awesome / css / font-awesome.css/> 

这就是我所有关于字体awesome的东西,我已经检查路径,





UPDATE



这是我在标题中加载一些内容的NGINX部分

  add_header Content-Security-Policystyle-src'self''unsafe-inline'
https://fonts.googleapis.com
https://fonts.gstatic.com
https:/ /themes.googleusercontent.com
https://assets.zendesk.com;
font-src'self'https://themes.googleusercontent.com
https://fonts.gstatic .com;;


解决方案

将.woff添加到应用程序服务器mime类型例如iis-> mime type)as application / font-woff


I do not know what is going on but in the browser console I can see 3 errors related to font-awesome

 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff2?v=4.3.0 
 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff?v=4.3.0
 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.ttf?v=4.3.0 

I know it is ridiculous I can not figure out this by myself, but everything seems to be OK, in my index.html I have something like this

<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css" />

and that's all I have related to the font-awesome thing, I already check the path and I am not wrong with that.

Is this happening with any of you guys ?

UPDATE

this is the NGINX part where I load some content in the headers

add_header Content-Security-Policy "style-src 'self' 'unsafe-inline'
https://fonts.googleapis.com
https://fonts.gstatic.com
https://themes.googleusercontent.com
https://assets.zendesk.com;
font-src 'self' https://themes.googleusercontent.com
https://fonts.gstatic.com;";

解决方案

Add the .woff to your application server mime type(e.g. iis-> mime type) as application/font-woff

这篇关于Font-Awesome错误404字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆