Skip to content

Instantly share code, notes, and snippets.

@valmirphp
Forked from anonymous/Cross domain webfont access
Last active August 29, 2015 14:23
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 valmirphp/0f634036eab33bfb016d to your computer and use it in GitHub Desktop.
Save valmirphp/0f634036eab33bfb016d to your computer and use it in GitHub Desktop.
# Cross domain webfont access
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2|svg)$ {
add_header "Access-Control-Allow-Origin" "*";
# Also, set cache rules for webfonts.
#
# See http://wiki.nginx.org/HttpCoreModule#location
# And https://github.com/h5bp/server-configs/issues/85
# And https://github.com/h5bp/server-configs/issues/86
expires 1M;
access_log off;
add_header Cache-Control "public";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment