I added DISCOURSE_CDN_URL: https://b7f7x2b6.stackpathcdn.com and rebuilt the app.
The site does not load properly. Upon inspection, I’m getting an Uncaught Syntax Error: … Missing / and I get Invalid or Unexpected Token
Then I tried DISCOURSE_CDN_URL: https://b7f7x2b6.stackpathcdn.com/ (I added the / at the end) and rebuilt the app.
Now I get the following error.
Refused to load the script 'https://b7f7x2b6.stackpathcdn.com/assets/browser-update-d924ff41586d6dcda055f0cfb41488724ba2e2d5271fef65ce5f480b46f9231d.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'report-sample' http://discuss.360velo.com/logs/ http://discuss.360velo.com/sidekiq/ http://discuss.360velo.com/mini-profiler-resources/ https://b7f7x2b6.stackpathcdn.com//assets/ https://b7f7x2b6.stackpathcdn.com//brotli_asset/ http://discuss.360velo.com/extra-locales/ https://b7f7x2b6.stackpathcdn.com//highlight-js/ https://b7f7x2b6.stackpathcdn.com//javascripts/ https://b7f7x2b6.stackpathcdn.com//plugins/ https://b7f7x2b6.stackpathcdn.com//theme-javascripts/ https://b7f7x2b6.stackpathcdn.com//svg-sprite/". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
DISCOURSE_CDN_URL should not have a slash at the end. Can you go back to your first attempt and then we can investigate the place from where that error is coming?
(true, Discourse should handle the CDN URL whether a slash was appended or not)
You’ll note that the CDN has stripped the important header: Content-Encoding: br that tells the browser “this response is brotli-encoded”. So it can’t interpret it properly.
You’ll need to change your CDN configuration to not strip this header.