Cors
m (Hans moved page Coors to Cors)
No edit summary
Line 1: Line 1:
To enable coors on IIS - all sites on the machine:
To enable cors on IIS - all sites on the machine:


Open the '''Machine'''. '''config'''
Add a or change web.config on the root web site (Default Web site)<pre><?xml version="1.0" encoding="utf-8"?> 
 
<configuration>   
The '''Machine'''.'''config''' file is '''located''' in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\'''CONFIG'''\directory
  <system.webServer>    
 
    <httpProtocol>       
Add this in configuration
      <customHeaders>         
<pre><system.webServer>
        <add name="Access-Control-Allow-Origin" value="*" />      
  <cors enabled="true" failUnlistedOrigins="true">
      </customHeaders>    
    <add origin="*" />
    </httpProtocol>  
  </cors>
  </system.webServer
</system.webServer></pre>To do this on App level - change Web.config
</configuration></pre>To do this on App level - change Web.config

Revision as of 19:03, 11 September 2020

To enable cors on IIS - all sites on the machine:

Add a or change web.config on the root web site (Default Web site)

<?xml version="1.0" encoding="utf-8"?>  
<configuration>    
  <system.webServer>      
    <httpProtocol>        
      <customHeaders>          
        <add name="Access-Control-Allow-Origin" value="*" />        
      </customHeaders>      
    </httpProtocol>    
   </system.webServer>  
 </configuration>

To do this on App level - change Web.config

This page was edited 42 days ago on 03/26/2024. What links here