Skip to content

Instantly share code, notes, and snippets.

@0xqd
Created September 17, 2013 19:58
Show Gist options
  • Save 0xqd/6599735 to your computer and use it in GitHub Desktop.
Save 0xqd/6599735 to your computer and use it in GitHub Desktop.
font awesome and firefox
# Apache config
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
# config.ru
# Allow font files to be loaded from anywhere (for loading webfonts in Firefox)
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '/fonts/*', :headers => :any, :methods => :get
end
end
# nginx config
if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
add_header Access-Control-Allow-Origin *;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment