Skip to content

Instantly share code, notes, and snippets.

@sergeifilippov
Created July 10, 2014 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergeifilippov/ea6a572189d87ef1d600 to your computer and use it in GitHub Desktop.
Save sergeifilippov/ea6a572189d87ef1d600 to your computer and use it in GitHub Desktop.
Loading webfonts in Firefox using Nginx
add this to any of your server blocks
```nginx
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
```
[Source](http://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx)
# add the webfont definitions to `/etc/nginx/mime.conf`
```nginx
types {
...
# fonts
font/ttf ttf;
font/eot eot;
font/otf otf;
font/woff woff;
...
}
```
## comment out `application/octet-stream eot;` on line 59ish
@sergeifilippov
Copy link
Author

And don't forget to restart nginx after all the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment