Page 1 of 2
No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Sat Feb 06, 2016 6:16 am
by varunvijay
i have a website
http://xookr.in and it has fonts that loads correctly.
but if i select a subdomain say for
http://thanjavur.xookr.in the fonts are not loading and in console i see error No 'Access-Control-Allow-Origin' header.
i followed the below said steps in the below given url.
http://forum.vestacp.com/viewtopic.php? ... gin#p29791
i added the line
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
in /home/user/config/web/nginx.conf
but even after adding it the fonts are not showing.
help me
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Sat Feb 06, 2016 10:10 am
by tjebbeke
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Sat Feb 06, 2016 1:13 pm
by varunvijay
added it but not working,
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Sun Feb 07, 2016 10:03 am
by skurudo
but even after adding it the fonts are not showing.
Silly question, do you restart nginx after adding new line in config?
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Tue Feb 09, 2016 6:22 am
by varunvijay
skurudo wrote:
Silly question, do you restart nginx after adding new line in config?
ADDED and RESTARTED but not working
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Fri Feb 12, 2016 11:59 am
by varunvijay
please help me i need to solve it ....
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Fri Feb 12, 2016 12:09 pm
by Mr.Erbutw
varunvijay wrote:please help me i need to solve it ....
and what writes in log domain error ? (errorlog)
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Fri Feb 12, 2016 1:10 pm
by tjebbeke
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Sun Feb 14, 2016 5:02 am
by varunvijay
error log dont have any entry related to this.
but the console is giving error as below:
Font from origin '
http://xookr.in' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '
http://thanjavur.xookr.in' is therefore not allowed access.
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
Posted: Tue Feb 16, 2016 5:49 am
by varunvijay
my nginx.conf
also contain this
location / {
proxy_pass
http://myipaddress:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|tt f|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai| eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|m kv|mov|mp4|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/website_name/public_html;
access_log /var/log/httpd/domains/website_name.log combined;
access_log /var/log/httpd/domains/mywebsite_name.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
do i have to edit this also or adding this
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";}
is enough