源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Apache、Nginx下Font Awesome在 Firefox 中不显示问题解决方法

  • 时间:2022-02-03 09:14 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Apache、Nginx下Font Awesome在 Firefox 中不显示问题解决方法
[b]一、Nginx服务器解决方法[/b] 服务器使用的是 Nginx,要在响应的头部添加 Access-Control-Allow-Origin 字段,添加方法是用 add_header 指令: 配置例子:
[u]复制代码[/u] 代码如下:
location /assets/ {     gzip_static on;     expires max;     add_header Cache-Control public;     add_header Access-Control-Allow-Origin *; }
[b]二、Apache服务器解决方法[/b] Font Awesome (firefox无法显示 火狐无法显示)Cross domain (跨域问题)  [b]The problem[/b] 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. [b]The solution[/b] After some investigations, I found out the workaround: set a Access-Control-Allow-Origin header to the font.
[u]复制代码[/u] 代码如下:
<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:
[u]复制代码[/u] 代码如下:
location ~* .(eot|otf|ttf|woff)$ {     add_header Access-Control-Allow-Origin *; }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部