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

 

posted on 2014-03-13 17:09  稻草人.Net  阅读(3173)  评论(1编辑  收藏  举报