[DOCUMENTATION] How to configure CORS for same-domain but all subdomains?
What's needed and why ?
I'm having a hard time finding out how to configure CORS for multiple subdomains, e.g. like done here in "vanilla" nginx.
How can this be achieved, and it would be very helpful to have this documented?
Hello @ppenguin,
You should be able to do it using custom configuration at server context (NGINX) so server-http (BunkerWeb). More info here : https://docs.bunkerweb.io/1.4/quickstart-guide/#custom-configurations
Anyway, I agree that we need to have some documentation about CORS or maybe even a dedicated core plugin to support it.
@fl0ppy-d1sk Thanks for the info, I'll try my luck (until now I've apparently also been running into syntax errors for my values to the related env vars, probably related to quoting)
Unrelated: the documentation is inconsistent where multiple (reverse proxy) env vars are concerned, i.e. it officially seems to use CUSTOM_HEADER_x with x a number, but also supports (which logically should probably even be mandatory to allow per-domain-application?) my.domain.com_CUSTOM_HEADER_x? So both the domain selector and a sequence (to allow multiple per domain) are presumably supported? To be fair, I might be referring to different sources that are "in the wild", but to counter that making the docs more explicit on that part might help.
Hello @ppenguin,
BunkerWeb now supports CORS settings since 1.4.3, more info here : https://docs.bunkerweb.io/1.4/security-tuning/#cors