Page 1 of 1

Cross-Origin Request Blocked Issue

Posted: Tue Mar 10, 2015 4:12 pm
by nelblack
Hi Everyone,

Have anyone knows how to resolve the Cross-Origin Request Blocked problem?

Re: Cross-Origin Request Blocked Issue

Posted: Tue Mar 10, 2015 4:35 pm
by skurudo
Hi, can you tell us more about problem?

From internet we know how, but... may be you have other issue?

http://benjaminhorn.io/code/setting-cor ... g-through/

Re: Cross-Origin Request Blocked Issue

Posted: Tue Mar 10, 2015 5:29 pm
by nelblack
Hi skurudo,

I was using WordPress and changed upload path to the sub domain, and the sub domain's folder was still at the root domain. The problem is one of the plugin copied the font icon to upload folder which is sub domain, and so the page can't load font icon because the CROS. is not enabling.

I have try to adding some settings below in location section with Nginx config, and that seems not helping.

Code: Select all

add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET';

Re: Cross-Origin Request Blocked Issue

Posted: Tue Mar 10, 2015 6:06 pm
by skurudo
Try this for apache2, it's from article above

# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]

Re: Cross-Origin Request Blocked Issue

Posted: Mon Dec 28, 2015 10:48 am
by skurudo