Devops
Solving Cross-origin Issue With Fonts on Nginx Server
In this post we learn to setup nginx to allow embedding font from 3rd party url in our rails app.
nginxcorsrails

When using Webfonts via @font-face or other CSS3 methods, some browsers like Firefox and IE will refuse to embed the font when it’s coming from a 3rd party URL because it’s a security risk. The solution is very simple, just add a few lines in your nginx.conf file to permanently solve the problem.
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}Compiled from: <a href=https://www.maxcdn.com/one/tutorial/how-to-use-cdn-with-webfonts/ rel=“nofollow” target=“_blank”>how to use cdn with webfonts
Keep reading


What did you take away?
Thoughts, pushback, or a story of your own? Drop a reply below — I read every one.
Comments are powered by Disqus. By posting you agree to theirterms.