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
BUGS IN TIKTOK WEB APP
In this article, I will discuss the bugs I have encountered while using the Tik Tok web app. When using the TikTok web app, I encountered a frustrating issue where I was unable to follow back users. This problem has persisted, leaving me with zero following despite my efforts to engage with the platform. As […]
read moreTHE BEST WOOCOMMERCE AFFILIATE AFFILIATE RETAILER PLUGIN FOR MAXIMUM PROFITS
In today’s highly competitive e-commerce landscape, leveraging the power of affiliate marketing has become a crucial strategy for online retailers to maximize their profits. And when it comes to running an efficient and lucrative affiliate program on your WooCommerce store, choosing the right plugin is paramount. The best WooCommerce affiliate retailer plugin that stands out […]
read more