# AWS CloudFront를 Discourse CDN으로 추가하는 방법

**URL:** https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115
**Category:** Self-hosting
**Tags:** cdn
**Created:** [11월 24, 2024, 10:49오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115 "2024-11-24T22:49:52Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jimmy0017](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jimmy0017](https://meta.discourse.org/u/jimmy0017)
#### Post date: [11월 24, 2024, 10:49오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/1 "2024-11-24T22:49:52Z")

</div>

이미지 등 객체를 AWS S3로 이동했습니다. 지금까지 잘 작동하고 있습니다.

이제 사이트를 조금 더 빠르게 만들고 싶습니다. AWS CloudFront를 DISCOURSE\_CDN으로 추가하는 방법을 어떻게 해야 하나요?

직접 설정을 시도해 보았습니다. forum-cdn을 사용하면 잘 작동합니다. 하지만 discourse\_cdn에 URL을 넣는 순간 사이트가 사용 불가능해지고, 모든 이미지에 여러 번의 리디렉션이 발생하여 정상적으로 표시되지 않습니다.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [11월 24, 2024, 11:08오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/2 "2024-11-24T23:08:09Z")

</div>

여기 있는 문서를 확인해 보셨나요:

> [@Enable a CDN for your Discourse](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857):
>
> So you’d like to use a CDN to speed up worldwide access to common assets on your Discourse forum? You might want to go all-in and [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) (see also [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916)). If you want a CDN without the added complexity of S3 and having two CDNs, this is the guide for you. The CDN will reduce some load on your server by letting the CDN serve those assets so that the server doesn’t have to. It also can speed things up by deliver…

그리고

> [@AWS CloudFront를 사용한 전체 사이트 CDN](https://meta.discourse.org/t/full-site-cdn-using-aws-cloudfront/208161):
>
> Hello All. I recently got my Discourse installation setup using AWS CloudFront (CF) for full site acceleration - and SSL offloading using AWS certs in CF. Note that this installation deviates from the official guide regarding CDN and SSL configuration - so that might be controversial and lead to future supportability issues. So be forewarned… there be dragons here. I am sharing the configuration that worked for me here: Setup discourse to listen on port 80 only and disable Let’s Encrypt by co…

---

<div class="post-metadata">

### Author: ![jimmy0017](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jimmy0017](https://meta.discourse.org/u/jimmy0017)
#### Post date: [11월 24, 2024, 11:13오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/3 "2024-11-24T23:13:58Z")

</div>

맞아요! 이 방법을 세팅에 사용했습니다.

> [@Enable a CDN for your Discourse](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857):
>
> So you’d like to use a CDN to speed up worldwide access to common assets on your Discourse forum? You might want to go all-in and [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) (see also [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916)). If you want a CDN without the added complexity of S3 and having two CDNs, this is the guide for you. The CDN will reduce some load on your server by letting the CDN serve those assets so that the server doesn’t have to. It also can speed things up by deliver…

하지만 두 번째 게시물에는 공식 세팅인지 확실하지 않은 내용이 포함되어 있습니다. 그리고 해당 게시물은 2021년에 작성된 것입니다.

```plaintext
“DISCOURSE_CDN_URL”을 구성하지 마세요.

```

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [11월 24, 2024, 11:17오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/4 "2024-11-24T23:17:32Z")

</div>

필요한 모든 정보는 이 주제부터 시작해 여기에 있습니다

> [@업로드를 위해 S3 호환 객체 저장소 제공자 구성하기](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916):
>
> information_source 이 주제는 몇 가지 일반적인 S3 호환 Object Storage 제공업체(S3 클론)를 설정하는 방법에 대해 다룹니다. 공식적으로 지원되며 Discourse의 호스팅 서비스에서 내부적으로 사용되는 Amazon AWS S3 설정에 대한 자세한 내용은 [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) 를 참조하세요. 제공업체 서비스 이름 Discourse와 호환? [Amazon AWS](https://meta.discourse.org/t/-/148916#p-738234-aws-s3-2) S3 예 [Digital Ocean](https://meta.discourse.org/t/-/148916#p-738234-digital-ocean-spaces-3) Spaces 예 [Linode](https://meta.discourse.org/t/-/148916#p-738234-linode-object-storage-4) Object Storage 예 [Google Cloud](https://meta.discourse.org/t/-/148916#p-738234-google-cloud-platform-storage-5) Storage 예 [Scaleway](https://meta.discourse.org/t/-/148916#p-738234-scaleway-object-storage-6) Object Storage 예 [Vultr](https://meta.discourse.org/t/-/148916#p-738234-vultr-object-storage-7) Object Storage 예 [BackBlaze](https://meta.discourse.org/t/-/148916#p-738234-backblaze-b2-cloud-storage-8) Cloud Storage 예\* 셀프 호스팅 [MinIO](https://meta.discourse.org/t/-/148916#p-738234-minio-storage-server-9) 예 [Azure Blob Storage](https://meta.discourse.org/t/-/148916#p-738234-azure-blob-storage-with-flexifyio-10)[Flexify.IO](https://flexify.io/) 예 [Oracle Cloud](https://meta.discourse.org/t/-/148916#oracle-cloud-12) Object Storag…

---

<div class="post-metadata">

### Author: ![jimmy0017](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jimmy0017](https://meta.discourse.org/u/jimmy0017)
#### Post date: [11월 24, 2024, 11:30오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/5 "2024-11-24T23:30:55Z")

</div>

이미 이 작업을 수행했습니다. 저희 사이트의 이미지는 AWS S3와 CloudFront에 저장되어 있습니다. 서버에 직접 요청하지 않고 user\_avatar와 같은 이미지를 더 많이 캐싱하려고 시도하고 있습니다.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [11월 25, 2024, 4:45오전 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/6 "2024-11-25T04:45:28Z")

</div>

> [@jimmy0017](#):
>
> AWS CloudFront를 DISCOURSE\_CDN으로 추가하는 방법은 무엇인가요?

S3 CDN은 DISCOURSE\_S3\_CDN으로 설정해야 합니다.

DISCOURSE\_CDN은 앱 CDN을 위한 것입니다.

---

<div class="post-metadata">

### Author: ![jimmy0017](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jimmy0017](https://meta.discourse.org/u/jimmy0017)
#### Post date: [11월 25, 2024, 1:36오후 UTC](https://meta.discourse.org/t/how-to-add-aws-cloudfront-as-a-discourse-cdn/338115/7 "2024-11-25T13:36:33Z")

</div>

이 부분은 이해하고 있습니다. 사이트에 전체 앱 CDN을 추가하려고 합니다. 따라서 `DISCOURSE_CDN`을 활용하고 싶습니다.
