Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using S3 CORS for serving fonts. If S3 domain name is used for serving fonts, it works in Firefox, but when CloudFront is used, it doesn't. Works with Google Chrome.

My CORS configuration on S3

<?xml version="1.0" encoding="UTF-8"?>
 <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
 <CORSRule>
     <AllowedOrigin>http://*.example.com</AllowedOrigin>
     <AllowedMethod>GET</AllowedMethod>
     <MaxAgeSeconds>30000</MaxAgeSeconds>
     <AllowedHeader>Content-*</AllowedHeader>
     <AllowedHeader>Host</AllowedHeader>
 </CORSRule>
 <CORSRule>
     <AllowedOrigin>https://*.example.com</AllowedOrigin>
     <AllowedMethod>GET</AllowedMethod>
     <MaxAgeSeconds>30000</MaxAgeSeconds>
     <AllowedHeader>Content-*</AllowedHeader>
     <AllowedHeader>Host</AllowedHeader>
 </CORSRule>
</CORSConfiguration>
share|improve this question
    
FYI, it works with Google Chrome because Google Chrome doesn't care about CORS for webfonts. –  ceejayoz Oct 26 '12 at 16:35

1 Answer 1

In order for me to get this working. I had to set the CORS configuration to include the CloudFront distribution domain.

I also had to change the settings in my CloudFront distribution behaviors, to Allow forwarding of query strings. I cant recall where I saw that was a requirement.

I then invalidated the fonts causing the issues.

Then we were good to go!

hope that helps

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>https://*.domain.com</AllowedOrigin>
        <AllowedOrigin>http://*.domain.com</AllowedOrigin>
        <AllowedOrigin>http://d2e7ljkkwgm4dt.cloudfront.net</AllowedOrigin>
        <AllowedOrigin>http://dpibywtcfxy6z.cloudfront.net</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Content-*</AllowedHeader>
        <AllowedHeader>Host</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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