# 在自有域或具有 CORS 的域上托管图片

**URL:** https://meta.discourse.org/t/hosting-image-on-own-domain-or-on-a-domain-with-cors/161668
**Category:** Support
**Created:** [2020年八月21日 14:37 UTC](https://meta.discourse.org/t/hosting-image-on-own-domain-or-on-a-domain-with-cors/161668 "2020-08-21T14:37:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lyseoy](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@lyseoy](https://meta.discourse.org/u/lyseoy)
#### Post date: [2020年八月21日 14:37 UTC](https://meta.discourse.org/t/hosting-image-on-own-domain-or-on-a-domain-with-cors/161668/1 "2020-08-21T14:37:13Z")

</div>

我正在尝试使用 stackblur 背景主题组件：

[https://meta.discourse.org/t/stackblur-backgrounds/79344](https://meta.discourse.org/t/stackblur-backgrounds/79344)

我觉得我卡在了这一步：

> [@Johani](#):
>
> 1. 将 `BACKGROUND_URL_GOES HERE` 替换为您图片的 URL  
> **（该 URL 必须托管在您的域名下，或者托管在已正确配置 [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) 的域名上）**

我第一次听说 CORS。谷歌告诉我 [imgur.com](http://imgur.com) 支持它，于是我上传了一张图片，获取了链接并在主题组件中尝试使用，但毫无效果。看来事情没那么简单！

有没有一种最简单的方法来托管兼容 CORS 的图片？还是说托管在自己的域名上更简单？Discourse 支持这样做吗？

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2020年八月21日 15:07 UTC](https://meta.discourse.org/t/hosting-image-on-own-domain-or-on-a-domain-with-cors/161668/2 "2020-08-21T15:07:24Z")

</div>

该主题组件已有一段时间未更新，而自其发布以来，Discourse 主题系统已发生了巨大变化。因此，我不建议您使用它。

我已将其移至 #customization:theme:broken-theme 分类，以避免进一步的混淆。

如果您还有其他与 Discourse 相关的 CORS 问题，欢迎随时创建新主题进行讨论。
