S3 图片上传被拒绝,但备份上传正常

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.

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.

您好,
我遇到了一个类似的问题,但原因不同。上传到备份存储桶成功了,但上传存储桶却不行。

后来发现是因为上传存储桶被设置为阻止所有公共访问。(我认为这现在是默认设置。)当我在本地测试上传时,一切正常,但 Discourse 使用的是“公共读取”权限进行上传,结果被 S3 拒绝了。(我原本以为 S3 会先保存文件的“公共读取”状态,然后再拒绝公共访问请求。)最终,我不得不通过添加额外的日志记录,才能查明上传时使用了哪些选项。

也许 Discourse 可以在设置“S3 上传存储桶”选项时,调用 GetPublicAccessBlock API 来检查存储桶的配置是否正确?

4 个赞

另一种可能性是,我们在设置指南中建议用户在上传存储桶前配置 CloudFront CDN,在这种情况下,应继续保持 public-read 的阻断措施。

我尚不确定在此处的成本与复杂度的权衡应如何考量。

1 个赞