How to add AWS Cloudfront as a Discourse CDN

We’ve moved the objects (such as image, and others) to AWS S3. Those have been great.

Now we want to speed up the site a bit more. How should I add the AWS cloudfront as the DISCOURSE_CDN?

I tried to setup myself. It works when I am using the forum-cdn. But as soon as I put the url into the discourse_cdn, the site becomes unusable and all images are having multiple redirects and stopped working.

Did you have a look through the documentation here:

also

Yap! I used this one as the way to setup.

But the second post contains which i am not sure if it is the official setup. And the post was from 2021.

Do not configure “DISCOURSE_CDN_URL”

Everything you need should be here, starting with this topic

I’ve already done this. The image of our site is on AWS S3 with cloudfront. I am trying to cache more such as the user_avatar image instead of hitting the server.

2 Likes