How to setup cloudfront for discourse

I can see discourse meta also using cloudfront. I tried to implement it on my forum but doesn’t get success. The cloudfront assets URL’s are redirecting back to my original URL. So please can anybody help me with correct way to add cloudfront in discourse forum.

4 Likes

Do you handled it or no?

1 Like

Hello guys, any update on this? Were you able to setup Cloudfront with Discourse? We are trying to do the same.

2 Likes

@Magnetidog I just got it to work.

I basically created the AWS Cloudfront distribution as explained in this video.

Then, I went to the admin panel and added my Cloudfront URL to the s3 cdn url key.

Then, I entered the container and rebaked all posts with rake posts:rebake (it took me around 10 min for every 7000 posts).

I also tried doing it in batches in the Rails Console, but for some reason this didn’t work: Post.in_batches.update_all('baked_version = NULL') (nothing happened 🤷🏻‍♂)

4 Likes