Created
July 10, 2014 02:08
-
-
Save sergeifilippov/ea6a572189d87ef1d600 to your computer and use it in GitHub Desktop.
Loading webfonts in Firefox using Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And don't forget to restart nginx after all the changes.