# 如何正确设置S3 bucket（非Amazon URL）？

**URL:** <https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612>\
**Category:** Self-hosting\
**Created:** [2020年七月23日 12:40 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612 "2020-07-23T12:40:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年七月23日 12:40 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/1 "2020-07-23T12:40:40Z")

</div>

所以我设置了一个 Amazon S3 存储桶来存放我的论坛资源，并将其绑定到自定义域名，同时配置了 CloudFlare CDN 来缓存内容。

我的自定义域名类似于 [http://forum-storage.com](http://forum-storage.com)，它指向 [https://forum-storage.com.s3-us-east-1.amazonaws.com](https://forum-storage.com.s3-us-east-1.amazonaws.com)。S3 存储桶本身的名称是 `forum-storage.com`。

目前一切运行正常。如果我在存储桶的主文件夹中添加一张图片，就可以通过自定义 URL 获取它，例如 [http://forum-storage.com/test.jpg](http://forum-storage.com/test.jpg) 会返回该图片，并带有 CloudFlare 的响应头。

有三个简单的问题…

## #1

现在我需要告诉 Discourse 使用这个新 URL 作为我的 S3 存储桶。在这三个字段中我应该填什么？

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/8/581914791044ac777b5092aa46bba4914a465ed7.png)

## #2

目前我的论坛帖子中包含的图片位于另一个 S3 存储桶中，还有一些图片是本地存储的。（我的图片 URL 分布非常杂乱。）

一旦我进行了正确的设置（如上所述），这意味着所有新添加到论坛的媒体文件都会进入新的存储桶，但现有的图片不会被移动，仍会从它们当前的位置访问，对吗？

## #3

既然从现在开始所有新图片都能正常工作，我该如何让 Discourse 将旧图片（那些不在新存储桶中的）全部迁移到这个新存储桶中（并在需要时重新生成帖子）？

目标是将所有内容都集中到这个新的、由 CDN 保护的存储桶中。

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年七月23日 16:33 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/2 "2020-07-23T16:33:58Z")

</div>

> [@pnoeric](#):
>
> S3 存储桶本身的名称为 `forum-storage.com`

🚨 立即停止 🚨

请创建一个名称中不包含点号的新存储桶。如果您继续操作，由于 SSL 通配符证书的工作原理，您将面临无尽的麻烦。

参考：[Discourse does not allow dot «.» symbol in bucket name while Amazon S3 allows it](https://meta.discourse.org/t/discourse-does-not-allow-dot-symbol-in-bucket-name-while-amazon-s3-allows-it/29251)  
参考：[https://stackoverflow.com/questions/62568657/ssl-certificate-issue-with-bucket-name-containing-dots-while-trying-to-use](https://stackoverflow.com/questions/62568657/ssl-certificate-issue-with-bucket-name-containing-dots-while-trying-to-use)

---

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年七月24日 09:36 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/3 "2020-07-24T09:36:23Z")

</div>

嗯，好的。暂时遇到点小问题！😉 谢谢你的提醒 @riking。

AWS S3 有一个功能：[如果你将存储桶命名为与域名相同，只需为域名添加一条 CNAME 记录，一切就能顺利运行](https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs)。

所以我现在到处寻找如何将域名附加到_与域名名称不同_的存储桶上的信息……嗯……

@BryanV，你是如何将 [https://discourse-uploads.bokeh.org](https://discourse-uploads.bokeh.org) 指向你的 S3 存储桶的？

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年七月24日 20:40 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/4 "2020-07-24T20:40:13Z")

</div>

嗯，这不错，但你希望在存储桶前面部署一个 CDN（例如 CloudFront），它会接收 CNAME，所以目前这个功能用处不大。

如果没有 CDN，你同样会收到高昂的流量账单。

---

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年七月25日 13:33 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/5 "2020-07-25T13:33:46Z")

</div>

好的。我想我们意见一致吧？为了更清楚，据我理解，连接 Discourse 和 S3 有三种方式：

1. 让 Discourse 直接使用 S3 云存储。 **优点** ：设置非常简单。 **缺点** ：费用会迅速增加。

2. 让 Discourse 通过自定义域名（例如 [forum-storage.com](http://forum-storage.com)）使用 S3 云存储，以便我可以使用 CDN。 **优点** ：如果存储桶名称与自定义域名完全匹配（即 `forum-storage.com.s3-amazon-aws.com`），通过 S3 设置非常简单。 **缺点** ：SSL 会出问题。

3. 让 Discourse 通过自定义域名（同样是为了使用 CDN）使用 S3 云存储，但配置 S3 存储桶使其名称中不包含额外的点（即 `forum-storage-com.s3-amazon-aws.com`）。 **优点** ：SSL 正常。 **缺点** ：在 Amazon S3 上设置起来不太容易。

所以……我一直使用方案 #1，直到收到账单 🙂 然后我了解到方案 #2 是一个选项，便进行了设置，并开启了这个主题，结果很快发现方案 #2 实际上并不行。

现在我正在尝试方案 #3。我想我必须使用 Amazon 的“Route 53”DNS 服务或类似的东西。仍在摸索中。我所有的谷歌搜索返回的都是关于如何实施方案 #2 的信息，但似乎没有人写过关于方案 #3 的清晰指南。

如果我理解有误或哪里错了，请纠正我……

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年七月26日 03:00 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/6 "2020-07-26T03:00:27Z")

</div>

针对这种情况有相关的教程，例如我刚刚找到了这篇关于 StackPath 的教程：

[https://support.stackpath.com/hc/en-us/articles/360001457743-Using-Amazon-S3-as-a-Site-Origin](https://support.stackpath.com/hc/en-us/articles/360001457743-Using-Amazon-S3-as-a-Site-Origin)

---

<div class="post-metadata">

**Author:** ![BryanV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryanv/32/226479_2.png) [@BryanV](https://meta.discourse.org/u/BryanV)\
**Post date:** [2020年七月27日 00:02 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/7 "2020-07-27T00:02:22Z")

</div>

> @BryanV 你是如何将 [https://discourse-uploads.bokeh.org](https://discourse-uploads.bokeh.org) 指向你的 S3 存储桶的？

我在 `bokeh.org` 的 DNS 配置中添加了一条 CNAME 记录，将其指向 Cloudfront CDN 分发对应的 _\<long id\>.cloudfront.net_ URL（在我们的案例中，[bokeh.org](http://bokeh.org) 托管在 Cloudflare 上，但这应该无关紧要）。

供参考，我们的 S3 存储桶名称中不包含任何点号，但我也记不起因此导致 CDN 设置出现任何问题（或者创建存储桶时遇到问题，它只需要一个唯一的名称即可）。

---

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年八月8日 10:43 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/8 "2020-08-08T10:43:12Z")

</div>

这毫无疑问是最令人沮丧的事情。我无论如何都想不通，如何将 Amazon S3 存储桶（存储桶名称中不能包含点号！）、我的自定义域名和 CloudFlare 串联起来，让它们真正协同工作。如果存储桶名称里能加点号，那就没问题了。但眼下这一切都太令人困惑了。啊啊啊啊啊，有人能帮帮我，或者指点我一种简单的方法来设置 CloudFlare 与 S3 存储桶的联动吗？_前提是该存储桶的名称与域名不同_。

我尝试了上面提到的 StackPath 信息——我觉得在 CloudFlare 里也做了类似的操作，但不太确定。结果不行。我试着阅读了 [CloudFlare 关于如何为 Amazon 存储桶添加 CDN 的说明](https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare#3Pc20UO7uY3kc51PbUJn9o)，但当然，他们要求存储桶名称必须与域名一致。有人告诉我这是个非常糟糕的主意，所以我不能这么做。

问题似乎归根结底在于：

- 如果存储桶名称与域名一致（带点号），Amazon S3 会帮我搞定一切，听起来很棒，但这会影响 SSL，所以我不该这么做。
- 如果存储桶名称与域名不一致，情况会变得极其复杂，而我完全搞不定。

有人能帮忙或给出建议吗？与此同时，我每个月都要为 S3 存储支付超过 100 美元的账单。这太糟糕了。我现在能不能直接付 200 美元请人一次性解决所有问题？真是让人抓狂。

---

<div class="post-metadata">

**Author:** ![Bill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bill/32/159342_2.png) [@Bill](https://meta.discourse.org/u/Bill)\
**Post date:** [2020年八月8日 10:52 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/9 "2020-08-08T10:52:31Z")

</div>

你读过这个吗？我在配置 S3 和 Cloudflare 时也遇到过困难，但最终解决了。你仍然可以使用 Cloudflare 来利用其安全优势，但我相当确定你还需要一个独立的 CDN 服务。Cloudflare 不像普通 CDN 那样工作，它的运作方式不同。你应该迁移到更便宜的 S3 服务，亚马逊的价格太贵了。

> [@Set up BackBlaze S3 with BunnyCDN](https://meta.discourse.org/t/how-to-setup-backblaze-s3-with-bunnycdn/159135/1):
>
> It took me forever to figure out how to do all of this, so I wanted to make this guide to make it easier for people. Serving your images this way is supposed to make your website load faster. My Discourse setup combines a DigitalOcean droplet, BackBlaze B2 S3, BunnyCDN, and the free version of Cloudflare. I went with these services after doing a bit of research into reliability, pricing, and benchmarks. They looked like the best options for me. Cloudflare helps with security, but will also slow…

---

<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:** [2020年八月8日 15:14 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/10 "2020-08-08T15:14:14Z")

</div>

使用 Cloudflare 缓存 S3 存储桶意味着您需要在请求中操作源站头部。该功能仅在 Cloudflare 的企业版计划中提供，因此使用其他 CDN 可能会更简单。

---

<div class="post-metadata">

**Author:** ![CA\_Tallguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ca_tallguy/32/191343_2.png) [@CA\_Tallguy](https://meta.discourse.org/u/CA_Tallguy)\
**Post date:** [2020年八月21日 21:30 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/11 "2020-08-21T21:30:28Z")

</div>

如果图像将通过 CDN 缓存，那么存储桶名称中的点是否无关紧要？唯一重要的是拥有能覆盖 Cloudflare 提供图像的优质证书。

我认为他应该专注于 Cloudflare 服务器、DNS 以及覆盖这些内容的证书。我认为用户或浏览器永远不会知道这些图像的源是 S3 存储桶。Cloudflare 会缓存/代理图像本身，对吧？

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年八月21日 22:26 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/12 "2020-08-21T22:26:42Z")

</div>

Discourse 将生成直接的存储桶 URL 并将其用于内部操作，例如“上传文件”。这仍然很重要。

---

<div class="post-metadata">

**Author:** ![CA\_Tallguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ca_tallguy/32/191343_2.png) [@CA\_Tallguy](https://meta.discourse.org/u/CA_Tallguy)\
**Post date:** [2020年八月22日 00:40 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/13 "2020-08-22T00:40:43Z")

</div>

@riking 所有 Discourse 似乎只需要一个存储桶名称，对吗？上传和管理可以通过 AWS 的 URL 及其证书完成，即使需要 HTTPS 也是如此。那么目前我们讨论安全证书有什么必要吗？

随后，原帖作者（OP）可以单独查看他需要做什么，以便让他的 CDN 或缓存解决方案从 S3 获取图片。无论是否安全，除非 OP 或 CDN 有特定要求，否则这并不重要，对吧？Discourse 是否关心他在 S3 和 CDN 之间的设置？

最后，OP 需要确保图片通过 CDN 以有效证书提供服务。这与 Discourse 有什么关系呢？除了 OP 提供图片最终驻留的基础 URL 之外，还有其他关联吗？一旦他的 CDN 或缓存从 S3 获取了图片，那么 AWS、存储桶等等就完全无关了。

我理解如果打算直接从 S3 提供图片，存储桶名称中的点号可能会引发问题，但 OP 并不打算这样做。因此，这仅仅归结为 OP 选择一个 Discourse 能接受的存储桶名称，只要它不干扰他与 CDN 的任何设置即可。

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年八月22日 00:47 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/14 "2020-08-22T00:47:09Z")

</div>

尽管可以避免使用域名形式的存储桶 URL，但由于 AWS S3 SDK 的使用方式以及配置的复杂性，实际上并未避免。

同样，这些操作会绕过 CDN，唯一的修复方法是在 Discourse 源代码中进行。这些问题可以修复，但目前尚未修复。许多问题也不出现在关键路径上，只会稍后显现。因此，在情况改变之前，请勿在存储桶名称中使用点号。

---

<div class="post-metadata">

**Author:** ![CA\_Tallguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ca_tallguy/32/191343_2.png) [@CA\_Tallguy](https://meta.discourse.org/u/CA_Tallguy)\
**Post date:** [2020年八月22日 01:39 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/15 "2020-08-22T01:39:23Z")

</div>

那么，为了把这个问题简化到最直白的程度……原帖（OP）的问题是：在配置三个设置时应该填入什么内容：

(1) 存储桶名称（BUCKET NAME）——也就是说，其中的点号是……不推荐？还是不允许？我怀疑这对原帖来说可能不是问题。（他只需要另外想办法让他的 CDN 缓存并提供图片。）所以我们都理解一致了吧？

(2) S3 端点（S3 ENDPOINT）——如果使用的是 AWS，就留空，无需填写；否则，他可以为其他提供商填写相应的内容？

(3) S3 CDN URL ——这是否就是 Discourse 会附加到图片路径前面的基础 URL？如果是这样，那就简单明了，原帖只需配置好他的 CDN 并提供该基础 URL 即可。

我没看出 SSL 通配符证书在这里有什么影响。原帖被告知 Discourse 配置中的点号不好，因为这会破坏他的证书。但如果他使用的是 CDN 或缓存，那么存储桶名称很可能与证书无关，对吧？如果这会在其他方面导致 Discourse 出问题，那了解这一点也是有用的。

---

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年八月22日 09:22 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/16 "2020-08-22T09:22:26Z")

</div>

我不确定自己是否完全跟上了所有细节，但稍微退一步来看，也许这组简单的要求会有所帮助：

## 目标：

1. 不将 Discourse 的图片存储在我的 Discourse 服务器上
2. 使用 S3 存储桶来存储图片（必须是 S3，因为这是 Discourse 支持的）
3. 避免产生昂贵的 S3 费用
4. CDN 并非必需，但作为一个不错的附加功能，它可能有助于减少（甚至是唯一能消除）昂贵的 S3 费用，同时还能提供更好的全球可用性，在主服务器离线时作为备份等等，等等

_如果以上内容有任何错误，请纠正我_

## 限制/要求：

1. 外部图片存储需要支持 S3 协议（因为 Discourse 使用此协议），但严格来说，并不需要是 **亚马逊** 的 S3。
2. Discourse 要求 S3 存储桶名称中不能包含点号。
3. 图片源（S3 或 CDN）必须通过 https:// 提供服务，因为如果页面是 https 而图片不是，浏览器会报错。

_如果以上内容有任何错误，请纠正我_

## 解决方案：

此前，我直接从亚马逊 S3 提供图片。效果很好，但亚马逊收取的 DataTransfer-Out-Bytes 费用非常昂贵。这导致我的亚马逊月度账单非常高！因此，我将其改回主服务器。针对此问题有两个可能的解决方案：在亚马逊 S3 存储桶前部署 CDN，让 CDN 处理所有数据传输；或者切换到其他 S3 提供商。

我尝试在亚马逊 S3 存储桶之上部署 CloudFlare CDN，但很快遇到了许多无法解决的问题。

### 另一个选择？

刚才看到了 [Digital Ocean 提供的兼容 S3 的存储服务。](https://www.digitalocean.com/products/spaces/) 它内置了 CDN（我不太确定具体是什么意思，但听起来很有前景），价格也很实惠。这能配合 Discourse 使用吗？

供参考，过去 30 天我从 S3 提供了约 300 GB 的数据。其中一部分是站点备份，大部分是静态图片。对我来说，要理清如何在亚马逊中测量这些数据非常困难……他们的计费报告界面——就像亚马逊 AWS 的其他一切一样——对管理员来说 _真的_ 很令人困惑。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2020年八月22日 15:38 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/17 "2020-08-22T15:38:35Z")

</div>

我认为最简单的方案是使用 AWS 和 KeyCDN，并遵循[使用对象存储进行上传（S3 及克隆服务）](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916)中的指南。如果您的用户不在南美洲，KeyCDN 价格相当实惠且配置简单。

一个可能更经济的方案是参考[如何配置 BackBlaze S3 与 BunnyCDN](https://meta.discourse.org/t/how-to-setup-backblaze-s3-with-bunnycdn/159135)。我在初步测试中将 BackBlaze 用于备份，对其表现感到满意，但尚未尝试将其用于上传。

---

<div class="post-metadata">

**Author:** ![CA\_Tallguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ca_tallguy/32/191343_2.png) [@CA\_Tallguy](https://meta.discourse.org/u/CA_Tallguy)\
**Post date:** [2020年八月22日 17:35 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/18 "2020-08-22T17:35:04Z")

</div>

我们之前因为存储桶名称中的点和浏览器证书问题而完全跑偏了，但我觉得那些讨论都毫无意义。任何 CDN 都支持 HTTPS 配置，因此关于“通配符证书”问题，以及存储桶名称中是否有“点”，在终端用户浏览器证书方面 **完全没有任何问题** 。因为再次强调，任何 CDN 肯定都支持这一点。

所以原帖作者只需：  
(1) 选择一个与 S3 和 CDN 兼容的存储方案，并在 Discourse 设置中配置端点和存储桶名称。  
(2) 配置 CDN 从 S3 拉取图片。安全或不安全都可以，我认为原帖作者并不在意，只要 CDN 通过 HTTPS 向用户提供服务即可。

如果有人发现我漏掉了什么，请纠正我。我认为“终端用户浏览器证书 + 存储桶名称中的点”这个问题，只有在直接从存储桶提供图片时才会出现。如果是通过 CDN 提供服务，则与此无关。

---

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [2020年八月23日 13:47 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/19 "2020-08-23T13:47:55Z")

</div>

附注：上面 @pfaffman 热心链接的该主题指出，Digital Ocean 的 S3 产品（“Spaces”）的 CDN“问题严重”。

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916):
>
> information_source This topic covers how to configure some common S3 compatible Object Storage providers (S3 clones). See [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) for more details about Amazon AWS S3 configuration, which is officially supported and used internally by Discourse for our hosting services. Provider Service Name Works with Discourse? [Amazon AWS](#aws-s3-2) S3 Yes [Digital Ocean](#digital-ocean-spaces-3) Spaces Yes [Linode](#linode-object-storage-4) Object Storage Yes [Google Cloud](#google-cloud-platform-storage-5) Storage Yes [Scaleway](#scaleway-object-storage-6) Object Storage Yes [Vultr](#vultr-object-storage-7) Obj…

我还看到，对于其他 S3 提供商，需要调整各种设置。

这告诉我：

- 即使所有提供商都声称遵循“S3”协议，设置也会因提供商而异。

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年八月25日 00:07 UTC](https://meta.discourse.org/t/what-are-the-right-settings-to-use-s3-bucket-with-non-amazon-url/158612/20 "2020-08-25T00:07:23Z")

</div>

仍然

> ⚠ 请勿在存储桶名称中使用点号（句号）

我的意思是，除非你享受痛苦。
