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 General Discussion
  • Search

No 'Access-Control-Allow-Origin' header -- help me to solve it.

General questions about VestaCP
Post Reply
  • Print view
Advanced search
11 posts
  • 1
  • 2
  • Next
varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Sat Feb 06, 2016 6:16 am

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
Last edited by varunvijay on Sat Feb 06, 2016 11:30 am, edited 2 times in total.
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by tjebbeke » Sat Feb 06, 2016 10:10 am

Try this:
http://stackoverflow.com/a/5009126
Top

varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Sat Feb 06, 2016 1:13 pm

added it but not working,
Top

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

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by skurudo » Sun Feb 07, 2016 10:03 am

but even after adding it the fonts are not showing.
Silly question, do you restart nginx after adding new line in config?
Top

varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Tue Feb 09, 2016 6:22 am

skurudo wrote: Silly question, do you restart nginx after adding new line in config?
ADDED and RESTARTED but not working
Top

varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Fri Feb 12, 2016 11:59 am

please help me i need to solve it ....
Top

Mr.Erbutw
Posts: 1040
Joined: Tue Apr 29, 2014 10:05 pm

Os: CentOS 6x
Web: apache + nginx
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by Mr.Erbutw » Fri Feb 12, 2016 12:09 pm

varunvijay wrote:please help me i need to solve it ....
and what writes in log domain error ? (errorlog)
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by tjebbeke » Fri Feb 12, 2016 1:10 pm

Look at this: http://enable-cors.org/server_nginx.html
Top

varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Sun Feb 14, 2016 5:02 am

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

varunvijay
Posts: 35
Joined: Sat Sep 12, 2015 6:57 am

Re: No 'Access-Control-Allow-Origin' header -- help me to solve it.
  • Quote

Post by varunvijay » Tue Feb 16, 2016 5:49 am

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
Top


Post Reply
  • Print view

11 posts
  • 1
  • 2
  • Next

Return to “General Discussion”



  • 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
 

 

cron

Login  •  Register

I forgot my password