# Want to understand s3\_cdn\_url files setting

**URL:** <https://meta.discourse.org/t/want-to-understand-s3-cdn-url-files-setting/45799>\
**Category:** Product Support\
**Created:** [17. Juni 2016 um 01:18 UTC](https://meta.discourse.org/t/want-to-understand-s3-cdn-url-files-setting/45799 "2016-06-17T01:18:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fearlessfrog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fearlessfrog/32/119653_2.png) [@fearlessfrog](https://meta.discourse.org/u/fearlessfrog)\
**Post date:** [17. Juni 2016 um 01:18 UTC](https://meta.discourse.org/t/want-to-understand-s3-cdn-url-files-setting/45799/1 "2016-06-17T01:18:55Z")

</div>

So we’re experimenting on using S3 for uploads. S3 is quite slow for, well anything really, so wanted to put a CDN like Cloudfront in-front of it. The setting :s3\_cdn\_url seems to be ideal for that. Using it is not quite what I expected though, so wanted help to check my understanding.

I can understand that it doesn’t change older posts without rebaking, but since enabling we see this on new posts:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/7/27f4857b3f74c6d961ccb1e7e214f545affaca4b.png)

So, the actual optimized/thumb is shown in straight Slow S3, but the full inside the lightbox is Cloudfront? Is that right, as it would seem that CloudFront could be used in-front of S3 all the time for images?

I guess the other way to go would be to map a custom DNS entry to the S3 bucket and let something like Cloudflare alias it? Anyone have experience with this?

EDIT: Hmm, can’t use s3 virtual hosting domains with Discourse as it doesn’t like the periods in the bucket name then. It makes setting up like this not possible:

> **[Virtual hosting of general purpose buckets - Amazon Simple Storage Service](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)**
>
> Use virtual hosting to serve multiple websites from a single web server.

..which then stops simple DNS Cloudflare (as in not even using Cloudfront) improvements, as we can’t have a [files.ourforum.com](http://files.ourforum.com) like mapping? Seems a bit of shame or maybe I am missing something?

EDIT2: Wildcard certs fault, ignore the edit bit if that helps.

---

_[View the full topic](https://meta.discourse.org/t/want-to-understand-s3-cdn-url-files-setting/45799)._
