# S3 image upload access denied while backups upload working fine

**URL:** https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071
**Category:** Self-hosting
**Tags:** s3
**Created:** [12월 12, 2018, 3:02오전 UTC](https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071 "2018-12-12T03:02:28Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [1월 4, 2019, 6:19오후 UTC](https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071/21 "2019-01-04T18:19:18Z")

</div>

> [@gerhard](#):
>
> But those folders aren’t empty, are they?

No they aren’t and they got structure internally. Just wanted to ensure that it’s okay to see only 2 folders and nothing else there.

> [@gerhard](#):
>
> Switching to option 2 is definitely the hardest. You’d need to rebake all posts after moving the files and updating the site setting

Now that’s VERY useful information. Maybe not include Option 2 at all since it could break many things. Infact in option 1 I’d probably highlight that one shouldn’t change the bucket for the uploads since it would require a rebake etc, only change the bucket for backups.

This is exactly what was looking for, don’t touch the upload, just move Backups to a new bucket or a sub folder.

---

<div class="post-metadata">

### Author: ![rcfox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcfox/32/115486_2.png) [@rcfox](https://meta.discourse.org/u/rcfox)
#### Post date: [3월 23, 2020, 8:18오후 UTC](https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071/22 "2020-03-23T20:18:14Z")

</div>

안녕하세요,  
다른 원인으로 인해 비슷한 문제를 겪었습니다. 백업 버킷에 대한 업로드는 정상적으로 작동했지만, 업로드 버킷은 작동하지 않았습니다.

원인은 업로드 버킷이 모든 공개 액세스를 차단하도록 설정되어 있었기 때문이었습니다. (현재 이것이 기본값인 것으로 생각합니다.) 로컬에서 업로드를 테스트했을 때는 정상적으로 작동했지만, Discourse는 “public-read” 액세스로 업로드를 시도했고, S3가 이를 거부했습니다. (S3가 파일에 “public-read” 상태를 저장한 뒤 공개 액세스 시도를 거부할 것이라고 예상했지만, 실제로는 그렇지 않았습니다.) 업로드에 어떤 옵션이 사용되는지 확인하기 위해 추가 로깅을 직접 삽입해야 했습니다.

Discourse가 “s3 upload bucket” 설정을 할 때 버킷이 올바르게 구성되었는지 확인하기 위해 [GetPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html) API를 사용할 수 있을지 고려해 보셨으면 합니다.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [3월 23, 2020, 11:35오후 UTC](https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071/23 "2020-03-23T23:35:49Z")

</div>

또 다른 가능성은 설정 가이드에서 업로드 버킷 앞에 CloudFront CDN을 배치하도록 권장하는 것입니다. 이 경우 public-read 차단 조치는 유지되어야 합니다.

여기서 비용과 복잡성 간의 트레이드오프가 어떻게 되어야 할지 명확하지 않습니다.

[이전 페이지](https://meta.discourse.org/t/s3-image-upload-access-denied-while-backups-upload-working-fine/104071.md?page=1)
