你是在 app.yml 中添加了这一行(还是在管理设置的 S3 CDN URL 中添加了域名)吗?
DISCOURSE_S3_CDN_URL: https://your.R2.domain.com # (你实际的 R2 自定义域名)
所有步骤也必须按正确的操作顺序执行:
- 管理后台的
app.yml设置 - 运行
rake migrate - 重新烘焙帖子
还有一个字符串替换工具可能有所帮助——请在容器内运行(将字符串替换为你自己的具体内容):
discourse remap "https://<cloudflare-account-id>.r2.cloudflarestorage.com/<R2-bucket-name>" "https://your.cdn.domain.com"