DISCOURSE_ENABLE_CORS not impacting Nginx config

I was able to modify the /etc/nginx/conf.d/discourse.conf file to include several Access-Control-... headers to avoid the Unknown error during log in when using SSO.

Now I want to trigger these Nginx settings via app.yml so that we don’t have to manually modify the Nginx config. However, when I specify the following settings in the environment section of app.yml and bootstrap via launcher, the Nginx config does not get updated.

Any idea as to what I am missing?

 ## Enable Cross-origin resource sharing so that SSO works properly
 DISCOURSE_ENABLE_CORS: true
 DISCOURSE_CORS_ORIGIN: '*'

The CORS headers are added via Rack, not nginx. The config should not be updated by adding those settings, but your site should start serving the correct headers.

5 Likes

Excellent. Confirmed this is the case: