Apache、Nginx下Font Awesome在 Firefox 中不显示问题解决方法
来源:互联网 发布:阿里云pc输入法 编辑:程序博客网 时间:2024/04/30 05:29
一、Nginx服务器解决方法
服务器使用的是 Nginx,要在响应的头部添加 Access-Control-Allow-Origin 字段,添加方法是用 add_header 指令:
配置例子:
复制代码代码如下:
location /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
二、Apache服务器解决方法
Font Awesome (firefox无法显示 火狐无法显示)Cross domain (跨域问题)
The problem
It seems that, for security reasons, Firefox simply don't allow you to use by default a font that is not hosted on your domain, not even on your subdomain. The CDN based websites can be also affected in this case.
The solution
After some investigations, I found out the workaround: set a Access-Control-Allow-Origin header to the font.
复制代码代码如下:
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
Also, if you are using nginx as your webserver you will need to include the code below in your virtual host file:
复制代码代码如下:
location ~* \.(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
0 0
- Apache、Nginx下Font Awesome在 Firefox 中不显示问题解决方法
- Font-Awesome IIS下不显示问题
- spring-boot中font-awesome在ie8中不显示的问题
- icon font在firefox下无法显示
- Font Awesome 在IE8下使用
- 在Android中使用Font-Awesome
- 在Android中使用Font-Awesome
- 在 ExtJS 中使用 Font Awesome
- 在WordPress主题中使用Font Awesome
- 在canvas中应用font-awesome字体
- font-awesome不出效果
- Ext2.2在FireFox下字体显示太小的问题解决方法
- 有了Font Awesome,再也不担心没图标用了----Font Awesome字体图标在android中的使用
- 使用font-awesome 在input框中增加一个图标
- 解决网站中上传的图片在IE中不显示 chrome firefox下却正常
- 网页在IE、Firefox、Opera中显示不兼容方法(包括CSS和JS)
- dwzjs在firefox下遇到页面加载问题解决方法
- javascript:window.close()在chrome,Firefox下失效问题解决方法
- 2014找工作总结-机会往往留给有准备的人
- Python Standard Library BaseHttpServer参数信息
- hdu 1022
- 伪回归的概念
- 聚簇索引和非聚簇索引区别的应用
- Apache、Nginx下Font Awesome在 Firefox 中不显示问题解决方法
- 数据挖掘之数据处理——SVM神经网络的数据分类预测-意大利葡萄酒种类识别
- Android文件访问权限和路径问题
- Map,List,Set类图
- aix 文件系统之 PROC
- AjaxSubmit图片上传success返回问题
- 最流行的4个机器学习数据集
- Hibernate/JPA中的继承映射 实体extends的关系(每个子类独立一个表)
- C语言中更新文件