Defining DISCOURSE_S3_CDN_URL links to assets in S3 CDN URL

Here’s some information about this, I was dealing with this last month.

I fixed it by setting both variables (DISCOURSE_S3_CDN_URL and DISCOURSE_CDN_URL) and creating two CloudFront distributions, one for the uploads with origin the S3 bucket, and one for the assets with origin the server.

Here’s the code we use for this

Here’s our app.yml (we named it web.yml), we replace variables at build time infra/web.yml at master · debtcollective/infra · GitHub

4 Likes