# 我的图片无法显示

**URL:** <https://meta.discourse.org/t/my-images-are-not-working/262680>\
**Category:** Self-hosting\
**Tags:** uploads, s3\
**Created:** [2023年四月24日 08:13 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680 "2023-04-24T08:13:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 08:14 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/1 "2023-04-24T08:14:00Z")

</div>

我的 Discourse 站点上已上传的图片不显示，但当我添加新图片时，它们会显示出来。  
已添加图片的响应头部的服务器是 s3，而新图片的服务器是 nginx，可能是什么问题？

---

<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:** [2023年四月24日 16:44 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/2 "2023-04-24T16:44:30Z")

</div>

欢迎您，@harshith_gogineni！很抱歉您遇到了麻烦。

您是通过其他方式进行的标准安装吗？

您是按照 [设置文件和图片上传到 S3](https://meta.discourse.org/t/set-up-file-and-image-uploads-to-s3/7229) 或 [为上传配置 S3 兼容对象存储提供商](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916) 或其他方式来配置 S3 的吗？

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 17:05 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/3 "2023-04-24T17:05:39Z")

</div>

我执行了标准安装，并且没有配置任何与图像存储相关的内容。那么默认情况下它们存储在哪里？  
“[https://cdck-file-uploads-europe1.s3.dualstack.eu-west-1.amazonaws.com/standard21/uploads/electricpe/original/1X/25412f80f49f66589ea142fb8a77ad82d0747501.png”](https://cdck-file-uploads-europe1.s3.dualstack.eu-west-1.amazonaws.com/standard21/uploads/electricpe/original/1X/25412f80f49f66589ea142fb8a77ad82d0747501.png%E2%80%9D)  
这是我上传的其中一张图片的当前网址  
它无法渲染，我收到了 403 响应。

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 17:07 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/4 "2023-04-24T17:07:47Z")

</div>

另外一件事是，我上传的新图片的链接不知何故被更改了  
/uploads/default/original/1X/b2dfce7644dea8b22e9e1e21079e3d1c676747cb.jpeg

---

<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:** [2023年四月24日 17:17 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/5 "2023-04-24T17:17:57Z")

</div>

> [@harshith\_gogineni](#):
>
> 默认情况下，它们存储在哪里？  
> “[https://cdck-file-uploads-europe1.s3.dualstack.eu-west-1.amazonaws.com/standard21/uploads/electricpe/original/1X/25412f80f49f66589ea142fb8a77ad82d0747501.png”](https://cdck-file-uploads-europe1.s3.dualstack.eu-west-1.amazonaws.com/standard21/uploads/electricpe/original/1X/25412f80f49f66589ea142fb8a77ad82d0747501.png%E2%80%9D)

那么您是由 CDCK 托管的，而不是自托管的。如果您认为有什么东西坏了，应该发送电子邮件至 [team@discourse.org](mailto:team@discourse.org)。

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 17:30 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/6 "2023-04-24T17:30:55Z")

</div>

我正在添加的新图片显示出来了？  
为什么它们被存储在不同的地方

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年四月24日 17:43 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/7 "2023-04-24T17:43:36Z")

</div>

您好 @harshith_gogineni 🙂

您现在是自托管的，但使用的是我们托管过的网站的备份吗？

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 17:44 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/8 "2023-04-24T17:44:34Z")

</div>

是的，正是如此，我之前使用的是你们的托管服务，但后来我迁移到了我自己的托管服务。

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2023年四月24日 18:41 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/10 "2023-04-24T18:41:03Z")

</div>

嘿 @harshith_gogineni，

你知道你导入到自托管实例的备份是否包含上传的文件吗？

因为如果你是由 Discourse 托管的，备份只包含数据库，除非你向支持部门请求了完整备份。

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/7/1/c7140152bbf65a3dfa4abf92d6f1e8d3eb303572.png)

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 18:45 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/11 "2023-04-24T18:45:20Z")

</div>

那么新上传的应该可以正常工作，对吗？

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2023年四月24日 18:59 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/12 "2023-04-24T18:59:00Z")

</div>

抱歉。当我们取消套餐时，我们会显示以下消息：

> 取消后，我们将创建您网站的_完整_备份，包括所有上传和附件，并在备份准备就绪时向您发送个人消息。

因此，您应该拥有一个包含上传内容的完整备份。我会尝试获取更多信息，因为您的图片似乎仍链接到旧网址。

---

<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:** [2023年四月24日 19:12 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/13 "2023-04-24T19:12:17Z")

</div>

> [@Canapin](#):
>
> 我的错。当我们取消计划时，我们会收到以下消息：  
> …

但是，如果您在 `include_s3_uploads_in_backups` 被设置（这仅在您取消计划后发生）之前进行备份，那么站点资产仍然在 S3 中，并且数据库会引用它们。您需要设法下载这些资产并相应地更新数据库。

这对新手来说并不容易。我相信有一些关于此的讨论。

---

<div class="post-metadata">

**Author:** ![harshith\_gogineni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harshith_gogineni/32/303866_2.png) [@harshith\_gogineni](https://meta.discourse.org/u/harshith_gogineni)\
**Post date:** [2023年四月24日 19:15 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/14 "2023-04-24T19:15:45Z")

</div>

我明白了，新上传的图片不会出现这种情况，对吧？

---

<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:** [2023年四月24日 19:20 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/15 "2023-04-24T19:20:11Z")

</div>

新上传的图片应该可以正常工作。如果不能，则需要修复。

最终，S3 上的图片将被删除，因此您需要在此之前将它们移至本地存储或您自己的 S3 存储桶。

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2023年四月24日 20:34 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/16 "2023-04-24T20:34:46Z")

</div>

> [@pfaffman](#):
>
> 最终，S3 上的图片将被删除

似乎它们已经被删除了：

> [@harshith\_gogineni](#):
>
> 我的 discourse 网站上已上传的图片未显示

---

<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:** [2023年四月24日 23:47 UTC](https://meta.discourse.org/t/my-images-are-not-working/262680/17 "2023-04-24T23:47:58Z")

</div>

你可以要求他们恢复这些文件，但你需要尽快将它们迁移到你自己的服务器或存储桶。
