Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Cross-Origin Request Blocked Issue

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Locked
  • Print view
Advanced search
5 posts • Page 1 of 1
nelblack
Posts: 11
Joined: Tue Jan 07, 2014 10:59 pm

Cross-Origin Request Blocked Issue

Post by nelblack » Tue Mar 10, 2015 4:12 pm

Hi Everyone,

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

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cross-Origin Request Blocked Issue

Post by skurudo » Tue Mar 10, 2015 4:35 pm

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

nelblack
Posts: 11
Joined: Tue Jan 07, 2014 10:59 pm

Re: Cross-Origin Request Blocked Issue

Post by nelblack » Tue Mar 10, 2015 5:29 pm

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';
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cross-Origin Request Blocked Issue

Post by skurudo » Tue Mar 10, 2015 6:06 pm

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

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cross-Origin Request Blocked Issue

Post by skurudo » Mon Dec 28, 2015 10:48 am

And some usefull URL -> http://enable-cors.org/server_nginx.html
Top


Locked
  • Print view

5 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password