# S3 데이터 내보내기 링크가 CDN URL을 사용하지 않음

**URL:** https://meta.discourse.org/t/link-to-data-export-on-s3-does-not-use-cdn-url/268573
**Category:** Bug
**Created:** [6월 16, 2023, 5:11오전 UTC](https://meta.discourse.org/t/link-to-data-export-on-s3-does-not-use-cdn-url/268573 "2023-06-16T05:11:32Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [6월 16, 2023, 5:59오전 UTC](https://meta.discourse.org/t/link-to-data-export-on-s3-does-not-use-cdn-url/268573/4 "2023-06-16T05:59:46Z")

</div>

다음 주제에서도 언급되었습니다.

- [Image lightbox "download" link pointing to S3 bucket not CDN](https://meta.discourse.org/t/image-lightbox-download-link-pointing-to-s3-bucket-not-cdn/265874)
- [Downloads coming from S3 even with DISCOURSE\_S3\_CDN\_URL set](https://meta.discourse.org/t/downloads-coming-from-s3-even-with-discourse-s3-cdn-url-set/177000)
- [S3 CDN URL not being used on non-image uploads - #4 by martin](https://meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332/4)

그리고 마지막 주제가 이 현상의 이유를 설명합니다:

> [@martin](#):
>
> 기본적으로 첨부파일 링크를 클릭하거나 이미지의 다운로드 버튼을 클릭할 때 발생하는 "강제 다운로드(force download)"를 수행하는 경우, 항상 사전 서명된 URL(presigned URL)을 통해 S3에서 다운로드합니다. 이렇게 해야 적절한 content-disposition 헤더를 추가할 수 있기 때문입니다:
> 
> ```plaintext
> attachment; filename="#{upload.original_filename}"; filename*=UTF-8''#{upload.original_filename}
> 
> ```
> 
> CDN URL이 이러한 방식으로 동작하도록 하는 것은 불가능하다고 생각합니다. 이미지의 경우 CDN URL은 인라인으로 표시할 때만 사용되며, 다운로드할 때는 사용되지 않습니다. 또한 개인 ACL이 있는 보안 이미지 및 첨부파일의 경우, 사전 서명된 URL을 _항상_ 사용해야 합니다.

다만, S3 버킷을 외부에 노출하지 않기 위해서라도 이러한 다운로드를 Discourse를 통해 프록시 처리할 수 있는 옵션이 있다면 좋겠습니다.

---

_[View the full topic](https://meta.discourse.org/t/link-to-data-export-on-s3-does-not-use-cdn-url/268573)._
