Proper configuration for CORS headers with Docker - app.yml or nginx/conf.d/discourse.conf within the container?

docker

#1

Continuing the discussion from How to enable Cross-origin Resource Sharing with docker:

The topic above explains setting CORS variables in containers/app.yml. This topic Cross domain rules, followed? describes setting it in the /etc/nginx/conf.d/discourse.conf file. I just had some quick questions:

  1. Does setting the variables in app.yml mean adjusting /etc/nginx/conf.d/discourse.conf inside the container is unnecessary?
  2. When setting the config in app.yml, does it go into the env: portion?

(Sam Saffron) #2

cors settings are passed using env, same way you pass any setting we have.

env:
   DISCOURSE_ENABLE_CORS: true
   DISCOURSE_CORS_ORIGIN: whatever.origin.com

Spoiler tag not working with CDN and CORS
#3

Is there a way to set the origin to multiple domains? * causes issues with AJAX requests.