How to setup Access-Control-Allow-Origin for IIS 8 in web config? Print

  • 0

Please follow the below steps to enable Access-Control-Allow-Origin in IIS 8 for web API calls.

  1. Open Internet Information Service (IIS) Manager.

  2. Select the website you required and click on HTTP Response Headers.

  3. Click on Add button at Actions pane.

  4. Enter the below details in Custom HTTP Response Headers.

  • Enter Access-Control-Allow-Origin as the header name.

  • Enter * as the header value.


  1. Hit OK Button.

  2. Now you will have to add the following code in your web.config file.

    <?xml version="1.0" encoding="utf-8"?>





           <add name="Access-Control-Allow-Origin" value="*" />





Was this answer helpful?

« Back