GoranStimac.com

How can I help

Stay informed and learn

Let's connect

How to solve the CORS problem with font files?

You have set the CDN and you have a problem with the fonts, here is the solution.

Apache

Add this block to the .htaccess file and the htaccess.conf file at the very beginning

<FilesMatch ".(eot|otf|ttf|woff|woff2)">
   Header set Access-Control-Allow-Origin "*"
</FilesMatch>

Nginx

Add this block to the virtual host file and restart Nginx:

location ~* .(eot|otf|ttf|woff|woff2) {
   add_header Access-Control-Allow-Origin *;
}

Once the additions have been made, it is still necessary to invalidate the files saved on the CDN.

Newer post

How to set up a LAMP stack on Ubuntu/Debian Linux server?

Older post

How to use search in Windows file explorer to select all files?

comments powered by Disqus

Looking for an IT professional?

Book a call Email me