RESOLVING ISSUE WITH CROSS ORIGIN RESOURCE SHARING POLICY FOR WEBSITES
May 12, 2016 / by Marco / Categories : Technology, website, WebsitesAnother issue that we experienced was displaying content from different domains especially when using HTTP and HTTPS. Here’s an example of the error message:
Font from origin ‘https://website’ 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://website’ is therefore not allowed access.
The fix is to add the following statement to either the .htaccess file or if you’re using nginx VPS then add it to the nginx.conf file in /etc/nginx/
add_header ‘Access-Control-Allow-Origin’ ‘*’;
Once you’ve added it to the nginx.conf file make sure to restart the service by using the command:
service nginx restart
Then you can test it by using curl -I http://website
If the curl result has Access-Control-Allow-Origin: * then it means the nginx changes worked.
OTHER ARTICLES YOU MAY LIKE
POWERFUL REFERRAL PROGRAM TOOL
Businesses of all sizes are constantly seeking new and innovative ways to grow their customer base and increase brand awareness. With the rise of social media and the reliance on word-of-mouth marketing, referral programs have become an essential tool for companies looking to expand their reach. However, managing a successful referral program can be a […]
read moreCYBER SECURITY PLATFORM FOR YOUR BUSINESS
Cyber security has become a top priority for individuals and organizations alike. With the ever-evolving threat of cyber attacks, it is imperative to have a strong and reliable security platform in place to protect sensitive information and data. That’s where Bleach Cyber comes in. As a leading cyber security platform, Bleach Cyber is dedicated to […]
read more