CORS configuration - AtlasOfLivingAustralia/documentation GitHub Wiki

Introduction

If your LA portal has different subdomains for each LA module you will need to allow the access from one subdomain to other, that is, you will need to configure Cross-origin resource sharing (CORS).

For instance this allows to access to your common branding header/footer and style resources from other subdomains, or to access to you biocache service from other subdomains (for instance from a data hub), et cetera.

CORS configuration

nginx configuration

Since PR 370 you can configure CORS in your nginx vhost proxies configuration via this variable:

nginx_cors_origin_regexp: '^https?:\/\/(localhost|l-a\.site|.*\.l-a\.site|.*\.other-allowed-subdomain\.org)'

This is a PCRE regexp. Test it with some tool like https://www.regextester.com/ to be sure that works for https://l-a.site, https://records.l-a.site or https://hub.other-allowed-subdomain.org et cetera.

CORS in LA configuration

In LA modules the CORS is configured via:

but for now, the defaults inventory options should work for you.