I have 2 servers.
1st have a cdn domain and on that, I am running font-awesome javascript and styles. Now I want to access that scripts by using the cdn link on my other site. I tried but it shows the below error (the below URL's are examples)
Access to fetch at 'https://cdn.xyz.com/fonts/Awesome/fa-regular-400.ttf' from origin 'http://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Appreciate your answers!
You can follow the below steps to set Access-Control-Allow-Origin in IIS:
Open Internet Information Service (IIS) Manager
Select the website you require and click on HTTP Response Headers.
In the Custom HTTP Response Headers, click Add
Enter Access-Control-Allow-Origin
as the header name, Enter * as the header value.
Hit the OK button.
Now, you will find the following code in your web.config file.
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>