I've just moved from my previous CDN to CloudFront for two of my websites. First one is working fine but I used the same snapshot in DigitalOcean to create the 2nd site and here I am getting

Access to Font at 'http://CLOUDFRONT_HOSTNAME.cloudfront.net/wp-content/themes/Newspaper/images/icons/newspaper.woff?14' from origin 'http://www.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.example.com' is therefore not allowed access.

I've tried all possible solutions available in online like adding a header in nginx.

location ~* \.(ttf|ttc|otf|eot|woff|svg|font.css)$ {
    add_header Access-Control-Allow-Origin *;

Then updating privacy in S3


Most of the solutions are this in various sites including other serverfault and stackoverflow solutions. I've also invalidated the font file in CloudFront, but no luck :(

Can someone please guide me what might be the issue? I've connected CloudFront via W3 Total Cache plugin in WP.


1. Whitelist Headers

Whitelist Headers

2. Invalidated the files

Invalidated the files

  1. Request and Response

Request & Response

Thanks in Advance


  • did you solve it? Jun 2, 2018 at 0:34

4 Answers 4


Are you sure that you are sending Authorization header with your GET requests for the fonts?

If not, in your S3 CORS policy change




This tiny miss had bugged me for a month.

  • Worst kind of bug. Jun 2, 2018 at 4:43
  • Yes it is 😔. It wasted so much of my time back then.
    – pTK
    Jun 2, 2018 at 7:29

I was looking for this today and wasn't able to find any working answer for my scenario.

I am using wordpress and using s3 bucket based origin push cdn with amazon cloudfront. However the font files were giving the error for CORS.

The error said:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://–domain–.cloudfront.net/wp-content/themes/Extra/fonts/ET-Extra.ttf. (Reason: CORS header ‘Access-Control_Allow-Origin’ missing).

The Solution was to set the CORS permissions from s3 bucket. But not the default ones. I changed them to:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

Make sure to change the domain-here to your own domain name.

Also, don't forget to clear your cache / invalidate the file which was giving issue, if needed.

You can see this tutorial for guidance too: https://nabtron.com/fix-access-control-allow-origin-missing/

I hope it helps.


In AWS console - CloudFront - Distribution edit behavior, in fordward header set Whitelist and add Origin from the whitelist headers.

  • Well, already tried this also.. added Origin and Access-Control-Allow-Origin, no change. Aug 5, 2017 at 12:19
  • have you invalidated cache?
    – drsromero
    Aug 5, 2017 at 12:19
  • Invalidated /wp-content/themes/Newspaper/images/icons/newspaper.woff.. not sure if it will work as still the same result. Aug 5, 2017 at 12:23
  • or do it take long time to clear the cache from CloudFront even after invalidate? Aug 5, 2017 at 12:23
  • Imgur: imgur.com/NkCLQho Aug 5, 2017 at 12:25

@Ariful Haque please add the below code to your .htaccess file. it will help you out.

# Allow access from all domains for webfonts.
# Alternatively you could only whitelist your
# subdomains like "subdomain.example.com".
<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
    Header set Access-Control-Allow-Origin "*"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .