nginx 里设置@font-face 跨域

server {
    ...
    # Fix @font-face cross-domain restriction in Firefox
    location ~* \.(ttf|ttc|otf|eot|woff)$ {
        add_header Access-Control-Allow-Origin *;
    }
    ...
}

原贴来自snipt.net

apache里设置@font-face 跨域

AddType application/vnd.ms-fontobject .eot
AddType application/x-font-woff woff
AddType font/ttf .ttf
AddType font/otf .otf
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

原文来自:cssbakery

 

server {
    ...
    # Fix @font-face cross-domain restriction in Firefox
    location ~* \.(ttf|ttc|otf|eot|woff)$ {
        add_header Access-Control-Allow-Origin *;
    }
    ...
}

原贴来自snipt.net

apache里设置@font-face 跨域

AddType application/vnd.ms-fontobject .eot
AddType application/x-font-woff woff
AddType font/ttf .ttf
AddType font/otf .otf
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

原文来自:cssbakery

 

相关文章:

  • 2021-06-08
  • 2022-03-06
  • 2021-07-20
  • 2021-10-09
  • 2021-08-27
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2022-02-07
  • 2021-10-05
  • 2022-12-23
  • 2022-02-16
  • 2022-01-19
相关资源
相似解决方案