Missing icons and svg files after enabling CDN ( CORS Policy issue)
-
Hey, as discussed earlier, I have started using AWS Cloudfront CDN for my WordPress site. But I noticed that everything is working well except there are missing icons or SVG files on my website. Have a look at this screenshot – https://a.cl.ly/v1uxYZRy You can notice that social icons are missing. On inspecting the console on chrome browser, I noticed this has something to do with CORS policy to send correct Access-Control-Allow-Origin headers. I read more information about this here – https://deliciousbrains.com/wp-offload-media/doc/configure-cors-to-resolve-web-font-issues/
I used these instructions on my Gridpane server but the issue still didn’t resolve.
Here is what I did – I created a site specific nginx config file with this command –nano /var/www/domain.com/nginx/awsbycdn.conf
and added this value to it –
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}and then I checked and reloaded Nginx. The setting was done properly but the issue hasn’t solved yet. What’s wrong with it?
kindly help me set this up.
Regards.
- The topic ‘Missing icons and svg files after enabling CDN ( CORS Policy issue)’ is closed to new replies.