Ajax is cross-domain. How to set multiple domain names in IIS's Access-Control-Allow-Origin?

I write header in the HTTP response header of IIS. How do I set up multiple domain names? Setting * is too unsafe

clipboard.png

the backend is written by php, but header will report an error when written in php, so it can only be written in IIS

.
Mar.23,2021

use URL Rewrite components:

in Web.config, the configuration allows cross-domain access to multiple specified domain names


IIS already has a dedicated CORS component, so please delete your own defined response header,

https://docs.microsoft.com/zh.

Menu