AccessControlAllowOrigin CORS Header With Multiple Domains

The AccessControlAllowOrigin CORS header does not allow multiple domains. This can be a problem in some cases. A workaround on the server is to detect the incoming Origin header, match against an allowed list and then generate the AccessControlAllowOrigin header using the domain. In Apache this can be accomplished with:

 

 

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.