RESOLVING ISSUE WITH CROSS ORIGIN RESOURCE SHARING POLICY FOR WEBSITESMay 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.
Limit to 5 sponsors.
OTHER ARTICLES YOU MAY LIKE
Have you been getting the blue Windows 10 Welcome screen? It normally pops up after installing Windows 10 or after a Windows 10 update. I’ve been receiving a lot of questions relating to this and there are a few ways to remove it. One way it to change the settings in the registry setting but […]read more
Technology changes and complex business requirements might compromise product data, impacting negatively on the company. Data synchronization ensures that information across the production chain is consistent. BizCaps achieves such streamlining with tools that collect data and sync it from the supplier to the consumer, increasing efficiency. Here are six reasons you require data synchronization. Increased […]read more