Internet Information Services
Microsoft web server software.
1,598 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I don't want to allow Access-Control-Allow-Origin for everything on the site sipotek - just a couple of files, is there a way to do this?
Hi @anwarjutt
You can use location element to set Access-Control-Allow-Origin for specific files, here is a Sample you can use as a reference:
<location path="Sample.txt">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.