RESOLVING ISSUE WITH CROSS ORIGIN RESOURCE SHARING POLICY FOR WEBSITES
May 12, 2016 / by Marco / Categories : Technology, website, Websites
Another 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
USING BUTTERNUT.AI TO CREATE PROFESSIONAL WEBSITES
Having a professional and efficient website is crucial for any business looking to thrive online. With the constant advancements in technology, it can be overwhelming to keep up with the latest tools and platforms available for website creation. However, by leveraging the innovative capabilities of Butternut.ai, businesses can maximize their efficiency and create stunning websites […]
read more
EASY AND SIMPLE AI VIDEO EDITING SOFTWARE
Imagine your favourite movie scene transformed into a video in minutes, not hours. Thanks to advancements in technology, editing software has become increasingly user-friendly. Wondershare’s Filmora 14 stands as a prime example, boasting an array of AI features that simplify the editing process, with AI voice capabilities that could turn your voiceover dreams into a […]
read more