# 禁用 CDN 和 S3，返回本地存储图片——最佳实践？

**URL:** <https://meta.discourse.org/t/disabling-cdn-s3-returning-to-local-storage-for-images-best-practice/359556>\
**Category:** Support\
**Created:** [2025年三月30日 22:22 UTC](https://meta.discourse.org/t/disabling-cdn-s3-returning-to-local-storage-for-images-best-practice/359556 "2025-03-30T22:22:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![decryption128](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@decryption128](https://meta.discourse.org/u/decryption128)\
**Post date:** [2025年三月30日 22:22 UTC](https://meta.discourse.org/t/disabling-cdn-s3-returning-to-local-storage-for-images-best-practice/359556/1 "2025-03-30T22:22:46Z")

</div>

我有一个小型 Discourse 论坛，它使用 Backblaze B2 作为对象存储，使用 BunnyCDN 作为 CDN，但现在想将所有内容移回 Discourse 服务器的本地存储。由于流量很低，目前分开使用 CDN 和对象存储的复杂性和成本不值得。

关于在使用 CDN 后恢复到本地存储的最佳实践或文档吗？我在论坛上找到了这篇帖子：

> [@Move S3 image to local host](https://meta.discourse.org/t/move-s3-image-to-local-host/155991/2?u=decryption128):
>
> I think the solution is: cd /var/discourse ./launcher enter app rake uploads:migrate\_from\_s3 Then disable site setting: disable: enable s3 uploads Then run: rake posts:rebake I haven’t tested it though, so you should wait for someone else to confirm.

就是这样吗？

运行 `rake uploads:migrate_from_s3`，在站点设置中禁用 S3/CDN，然后运行 `rake posts:rebake` 来修复所有帖子 URL？

---

_[View the full topic](https://meta.discourse.org/t/disabling-cdn-s3-returning-to-local-storage-for-images-best-practice/359556)._
