国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Apache > 正文

Apache、Nginx下Font Awesome在 Firefox 中不顯示問題解決方法

2024-08-27 18:23:35
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了Apache、Nginx下Font Awesome在 Firefox 中不顯示問題解決方法,在配置中增加一個響應頭即可解決這個問題,需要的朋友可以參考下

一、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 *;
}

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 桃园县| 静乐县| 普宁市| 芦溪县| 临桂县| 乌鲁木齐县| 宁阳县| 林周县| 昭觉县| 苏尼特左旗| 临海市| 郸城县| 吉安市| 乌兰浩特市| 电白县| 德清县| 云阳县| 中牟县| 通河县| 白河县| 岳阳县| 苗栗县| 五大连池市| 武强县| 祁阳县| 文化| 当涂县| 昌乐县| 莒南县| 黄浦区| 黔南| 巴楚县| 秀山| 江孜县| 西林县| 广德县| 利辛县| 铜山县| 监利县| 大化| 砀山县|