Problem
You keep getting Control Allow Origin errors on fonts that are pulling from your CloudFront CDN
Solution
You need to make changes at CloudFront and your IIS 7 Server
CloudFront Changes
Modify the origin behaviors:
- Navigate to the CloudFront Distributions Panel
- Select your Distribution
- Click Behaviors Tab
- Select Behavior from list items
- Click Edit
- Under “Whitelist Headers” section add the following headers:
- Access-Control-Allow-Origin
- Origin
- Click “Yes, Edit”
- Wait for changes to propagate
- Clear cache of any font assets
IIS7 Changes
You will need a new outbound rewrite rule:
<rule name="Add Cross Origin Access">
<match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" />
<conditions>
<add input="{REQUEST_URI}" pattern=".*\.(ttf|otf|eot|woff|svg)\?*.*$" />
</conditions>
<action type="Rewrite" value="*"/>
</rule>
waht is REQUEST_URI