haha
(user494)
22 juli 2026 om 23:09
1
Hello everyone, thanks for your time.
After setting Cloudflare R2 on my discourse, I can’t upload photo in creating topic, here is my setting:
I confirm I use the Account API Tokens(it’s active), not User API Tokens. Permission is Object Read & Write.
And I have set custom domain for the uploads bucket, it’s active:
And set the CORS Policy:
But I can’t upload photos after setting all above. Anyone can help to solve it? Many thanks!
haha
(user494)
22 juli 2026 om 23:11
2
here is custom domain and CORS setting
Lilly
(Lillian )
23 juli 2026 om 00:00
3
hi @haha welcome
you should set the region to US East (N. Virginia):
does your CORS policy on cloudflare via json looks like this? you need the ETag exposed header.
[
{
"AllowedOrigins": [
"https://forum.example.com"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE",
"HEAD"
],
"AllowedHeaders": [
"*"
],
"ExposeHeaders": [
"ETag"
],
"MaxAgeSeconds": 3000
}
]
Lilly
(Lillian )
23 juli 2026 om 00:06
4
btw, you should follow this documentation here exactly: Configure an S3 compatible object storage provider for uploads
Cloudflare R2 is compatible with S3 object storage when using Cloudflare CDN. Cloudflare’s free plan offers 10GB of storage which should be more than plenty for most forums’ needs.
To configure Cloudflare R2, you will need to configure the relevant settings in the Cloudflare dashboard under R2 Object Storage.
haha
(user494)
23 juli 2026 om 11:04
5
hi, my CORS policy is same as yours. After setting S3 region to N. Virginia, it works! Thanks for your advice!
I tried some regions except Virginia, all failed. Only Virginia works. This is a tricky point, as I found other document didn’t highlight this, they said “choose a nearest region is OK”. But experiment proves only Virginia is the right choice!
Thanks!