# Digital Ocean Spaces/S3 的奇怪行为以及 \`example.com\` 大量重复的 CORS 规则

**URL:** <https://meta.discourse.org/t/strange-behavior-with-digital-ocean-spaces-s3-and-lots-of-duplicated-cors-rules-for-example-com/212361>\
**Category:** Self-hosting\
**Created:** [2021年十二月16日 22:03 UTC](https://meta.discourse.org/t/strange-behavior-with-digital-ocean-spaces-s3-and-lots-of-duplicated-cors-rules-for-example-com/212361 "2021-12-16T22:03:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [2023年五月9日 10:11 UTC](https://meta.discourse.org/t/strange-behavior-with-digital-ocean-spaces-s3-and-lots-of-duplicated-cors-rules-for-example-com/212361/3 "2023-05-09T10:11:42Z")

</div>

你好，

抱歉复活这个话题，但我想我几天前遇到了一个相关问题。

我的设置：

Digital Ocean Spaces，具有 `s3:upload_assets` 和 `s3:expire_missing_assets`。  
CDN - Bunny

似乎每次重建或管理员更新上传资产时，都会生成一个新的 CORS 规则。实际上是复制了原始规则。不幸的是，我没有复制控制台错误消息，但在上传资产之前，它曾显示“已达到 CORS 规则的最大数量 100”。所以我去了 Digital Ocean 检查规则，发现确实有 100 条。😃 所以我做了和 @pfaffman 一样的操作，我删除了一个，它删除了所有规则。之后，资产在重建时成功上传。

设置时，我遵循了这里的说明：[Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916?u=dodesz%EF%BC%8C%E4%BD%86%E8%AF%A5%E8%AF%B4%E6%98%8E%E5%B0%9A%E6%9C%AA%E5%8C%85%E5%90%AB%E6%AD%A4%E8%A1%8C%E3%80%82)

> [@Falco](#):
>
> `DISCOURSE_S3_INSTALL_CORS_RULE: false`

添加这一行是否可以阻止生成重复的 CORS 规则？谢谢 🙂

---

_[View the full topic](https://meta.discourse.org/t/strange-behavior-with-digital-ocean-spaces-s3-and-lots-of-duplicated-cors-rules-for-example-com/212361)._
