# 403 forbidden for thumbnails on s3 when running with CDN

**URL:** https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [April 26, 2023, 2:40pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967 "2023-04-26T14:40:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)
#### Post date: [April 26, 2023, 2:40pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/1 "2023-04-26T14:40:48Z")

</div>

We use the official Docker hosting setup on AWS based on [GitHub - aws-samples/aws-cdk-for-discourse: AWS CDK for Discourse · GitHub](https://github.com/aws-samples/aws-cdk-for-discourse).

The general CDN setup works fine, e.g. images are delivered fine via CDN URL.

However the initial “32x32” request seems to go to the S3 bucket URL which yields a 403.

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/f/b/9fb45094b48339f1989052b5648b6d783cdd884a.png)

Did I miss a configuration bit or is it a bug?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 26, 2023, 5:01pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/2 "2023-04-26T17:01:01Z")

</div>

> [@nodomain](#):
>
> We use the official Docker hosting setup on AWS based on [GitHub - aws-samples/aws-cdk-for-discourse: AWS CDK for Discourse](https://github.com/aws-samples/aws-cdk-for-discourse).

That’s not official, as it’s an AWS project using a bitnami image for Discourse which we explicitly do not recognize as an official [standard install](https://meta.discourse.org/t/142537?silent=true) of Discourse, making this outside of the scope of installs that we support here.

> [@nodomain](#):
>
> Did I miss a configuration bit or is it a bug?

Not a bug as it’s not running the app the way we intend it to be ran, but it may be fixed with a config change. Maybe open an issue about this on the sample repository ?

---

<div class="post-metadata">

### Author: ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)
#### Post date: [April 26, 2023, 7:49pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/3 "2023-04-26T19:49:49Z")

</div>

The referenced project uses the official Docker image.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/f/7/2/f720996ec7bfa408157e68df988cd15d7694386d.png)

> <https://github.com/aws-samples/aws-cdk-for-discourse/blob/main/lib/ec2-nested-stack.ts#L150>

No Bitnami - I would not have used that in the first place either 😉

I am going to dig into it and report an issue either there, or here.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 26, 2023, 8:03pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/4 "2023-04-26T20:03:12Z")

</div>

> [@nodomain](#):
>
> The referenced project uses the official Docker image.
> 
> No Bitnami - I would not have used that in the first place either 😉

Oh, sorry I went by what is written in the project README.md

> <https://github.com/aws-samples/aws-cdk-for-discourse/blob/main/README.md?plain=1#L19>

> [@nodomain](#):
>
> I am going to dig into it and report an issue either there

Good luck. Please update here if you find any clues.

---

<div class="post-metadata">

### Author: ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)
#### Post date: [April 26, 2023, 8:48pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/5 "2023-04-26T20:48:43Z")

</div>

Pull request for README incoming 😉

---

<div class="post-metadata">

### Author: ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)
#### Post date: [April 27, 2023, 1:15pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/6 "2023-04-27T13:15:02Z")

</div>

I found the issue. I restored a backup from another system.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 27, 2023, 1:47pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/7 "2023-04-27T13:47:00Z")

</div>

What was broken then?

---

<div class="post-metadata">

### Author: ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)
#### Post date: [April 27, 2023, 2:12pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/8 "2023-04-27T14:12:22Z")

</div>

Somehow it used the s3 URL for the default Discourse system user avatar image. I did not spend time fixing it because I am still in progress of regularly recreating the environments due to some testing activities.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 27, 2023, 2:12pm UTC](https://meta.discourse.org/t/403-forbidden-for-thumbnails-on-s3-when-running-with-cdn/262967/9 "2023-05-27T14:12:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
