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
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