Uploads to AWS S3 and Configured CDN

I have my Discourse instance set up since 2019 on a DigitalOcean server, configured so traffic goes through Cloudflare. Today I migrated my uploads and backups to S3, and after completing the migration I saw this warning on my Admin dashboard:

Some advice based on your current site settings

Discourse doesn’t know that Cloudflare is routing traffic to it, so it makes sense that this warning appears. But given that I’m on the free tier of Cloudflare and that it still provides some degree of caching, is it still recommended for me to configure a CDN? If so, what additional steps do I need to take to properly configure DISCOURSE_CDN_URL? What value should I set that env variable to?

Thanks in advance.

I would say you should configure a CDN (preferably cloudfront) try not to use cloudflare optimisations with discourse as those are known to break things.

Are you sure that Cloudflare is caching your uploads and backups? Does your S3 bucket have a DNS name which is proxied by Cloudflare?

Proxying the site FQDN isn’t enough.

1 Like