How to enable Cross-origin Resource Sharing with docker


(Josh) #1

This was a setting in our discourse.conf file prior to moving over to docker. Where should we be setting this now?


Enabling CORS on DigitalOcean / Docker install
Proper configuration for CORS headers with Docker - app.yml or nginx/conf.d/discourse.conf within the container?
How to get current user?
(Sam Saffron) #2

AFAIK we have an env var for this: https://github.com/discourse/discourse/blob/master/config/initializers/08-rack-cors.rb

DISCOURSE_CORS_ORIGIN it seems.


(Josh) #3

For those that run into this in the future, you should be setting it something like this in your app.yml

DISCOURSE_ENABLE_CORS: true
DISCOURSE_CORS_ORIGIN: '*'

Is it possible to run Docker install locally?
(Régis Hanol) #4