Page 1 of 1

Cannot Access Remote CSS files from VestaCP

Posted: Sat Mar 27, 2021 3:47 am
by Vegas10128
<r>Hello everyone, <br/>
<br/>
Recently came across similar issues related to <br/>
<URL url="viewtopic.php?t=10544"><LINK_TEXT text="viewtopic.php?t=10544">viewtopic.php?t=10544</LINK_TEXT></URL><br/>
<br/>
My issue is
<CODE><s>

Code: Select all

</s>Access to imported resource at 'https://website-cdn.com/css/fontawesome-all.min.css' from origin 'https://website.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.<e>
</e></CODE>

How i am accessing the following css files via html.
<CODE><s>

Code: Select all

</s><link rel="import" href="https://website-cdn.com/css/fontawesome-all.min.css"><e>
</e></CODE>

and have tried using async
<CODE><s>

Code: Select all

</s><link rel="import" href="https://website-cdn.com/css/fontawesome-all.min.css" async><e>
</e></CODE>

I have attempted the following.
<CODE><s>

Code: Select all

</s>add_header Access-Control-Allow-Origin "*";<e>
</e></CODE>
in vesta nginx conf file for domain. <br/>
I have also attempted the same implementation for .htaccess file as well.<br/>
<br/>
However it does not work. <br/>
<br/>
I will also state,
<CODE><s>

Code: Select all

</s><script src="https://website-cdn.com/js/javascript-file.js" type="text/javascript"></script><e>
</e></CODE>

Works just fine however, it is a javascript file. <br/>
<br/>
Ideally website.com is hosted on the primary vestacp server. <br/>
and website-cdn.com is hosted on a separate vestacp server at a different location.<br/>
<br/>
<br/>
What is causing the issue for CORS error code only on css files? Why would this be working for .js files and not CSS? would this be a vesta bug?</r>

Re: Cannot Access Remote CSS files from VestaCP

Posted: Mon Apr 05, 2021 4:38 pm
by Varitrix
Have you tried using any data recovery software?