1

My site was working fine before implementing CDN. However, after implementing CloudFront CDN, only fonts(woff2) and Luma Icons are not working. All other static and media content are loading perfectly fine. I'm attaching my Cloudfront Settings and HTACCESS files of Static folder.

I'm seeing the following error in both Chrome and Firefox enter image description here

AWS CloudFront General Settings enter image description here

AWS CloudFront Origin Settings enter image description here

AWS CloudFront Bheaviour Settings enter image description here

And, my static folder htaccess has following code

<IfModule mod_headers.c>
   <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$>
      Header set Cache-Control "max-age=604800, public"
      Header set Access-Control-Allow-Origin "*"
      Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
      Header set Access-Control-Max-Age "604800"
      Header set Access-Control-Allow-Headers "Host, Content-Type, Origin, Accept, X-Requested-With"
   </FilesMatch>
   <FilesMatch .*\.(zip|gz|gzip|bz2|csv|xml)$>
       Header append Cache-Control no-store
   </FilesMatch>

</IfModule>

If it matters, I also use Varnish and changed Apache2 ports to 8080. SSL certificates used in Cloudfront are created by AWS itself and main domain SSL is from Let's Encrypt.

Also, why is it trying to download fonts and icons files twice?

1 Answer 1

1

In order to determine which assets are served through CDN, you can navigate to the "Behavior" section within your distribution settings. Here, you have the ability to selectively add or exclude specific assets based on your needs. This provides a streamlined approach to managing your assets and ensures that they are being served efficiently through the CDN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.