Forum

CORS policy settings

Fred
7 December 2018, 12:39
Hi,

I am hosting WordPress on an AWS EC2 instance using FreeBSD and Hiawatha.
We also use Amazon cloudfront.
For some reason, some of our icons is not showing and when we look at the chrome console, we see the following:
(index):1 Access to font at 'https://cdn.routesrunwell.com/content/themes/RRW/core/admin/fonts/modules.woff' from origin 'https://mydomain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

So to remedy this issue, i hadded the following in my VirtualHost setting:
## Header
CustomHeader = X-Frame-Options: sameorigin
CustomHeader = Vary: Accept-Encoding
CustomHeaderClient = Access-Control-Allow-Origin: *


Unfortunately, I still have the issue.

Could anyone please advise on what to do in Hiawatha setting in order to solve this issue

Thank you
Fred
8 December 2018, 10:53
The problem was with S3 setting and not with hiawatha...
Bellow is the link for solution if anyone else ever wonders how i fixed it.
https://www.naschenweng.info/2014/09/23/wordpress-w3-total-cache-cloudfront-font-cors-issue
This topic has been closed.