font-face 跨域解决

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
<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

原文来自:cssbakery

 

你可能感兴趣的:(font)