Question

Font CORS problem when use Space'CDN

Posted October 4, 2018 1.1k views
CentOSCDN

I’ve used Space'CD to upload my assets but when I’m trying to load font I got CORS problem. Should i add some config in my server ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

The following error is :
Access to font at ’https://santalabspace.sgp1.digitaloceanspaces.com/fonts/fontawesome-webfont.woff2?v=4.7.0’ from origin ’<URL>’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

It’s been a while since you posted this and I hope you’ve resolved your issue. However for the sake of searches throughout the land I had a similar issue and stumbled across your post and hoped for an answer for myself but evidently to no avail.

Anyway, I found that defining my CORS policy with my domain and adding just the header Access-Control-Allow-Origin, then flushing the cache of the fonts allowed them to work on my website.

The CORS policy you set on files does not take effect until you flush the cache.

  • Thank you for posting! I swapped out the droplet behind one of my domains and could not figure out why the CORS policy stopped working. I purged the CDN cache and it worked like a charm after that!

Submit an Answer