Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

CORS errors when hosting MathJax

$
0
0
I am trying to host MathJax on our location network (IP 10.0.x.y, no hostname) using the following nginx config:

server {
listen 80;
server_name _;

location ~* \.(ttf|ttc|otf|eot|woff|font.css)$ {
add_header "Access-Control-Allow-Origin" "*";
expires 1M;
add_header Cache-Control "public";
}

location /misc/ {

root /var/www/html/;
}
}

I am getting a lot

Access to font at 'http://10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5:1 GET http://10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5 net::ERR_FAILED

errors in chrome.

How to correctly allow access to these fonts?


P.S.: I am using nginx/1.10.3

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>