# 所有插件因最近升级后的 CORS 错误而无法运行

**URL:** https://meta.discourse.org/t/all-plugins-not-functioning-due-to-cors-error-after-recent-upgrade/399466
**Category:** Self-hosting
**Tags:** cdn
**Created:** [2026年三月27日 20:35 UTC](https://meta.discourse.org/t/all-plugins-not-functioning-due-to-cors-error-after-recent-upgrade/399466 "2026-03-27T20:35:59Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2026年四月1日 09:50 UTC](https://meta.discourse.org/t/all-plugins-not-functioning-due-to-cors-error-after-recent-upgrade/399466/12 "2026-04-01T09:50:27Z")

</div>

@pfaffman @TomoftheFog @tanya_byrne @denvergeeks 能否请你们确认一下资源是如何配置的？你们是否仅使用了 CDN 加应用服务器？还是也将资源存储在 S3 或兼容 S3 的存储中？

如果您使用的是 S3 或兼容 S3 的存储，那么不幸的是，唯一可靠的方法是添加一些特定于 CDN 的配置。我原本以为这个议题是关于 S3 资源的，但现在我不太确定了？

对于使用简单 CDN 对接应用服务器的用户，按理说不应该需要任何额外的配置工作。它应该“自动生效”，与 theme-javascripts 和 hightlightjs 捆绑包完全一样。但看起来我们的默认 NGINX 配置中确实缺少了某个请求头。对此我们深表歉意！

以下内容应能使功能恢复正常：

> <https://github.com/discourse/discourse/pull/39031>
>
> In a standard install, where assets are loaded from the same-origin, this makes …no difference.
> 
> But when a CDN is used, this CORS header is required for \`type="module"\` JavaScript assets to load correctly. It's also possible to configure this in the CDN itself, but making this change in core should work everywhere.

合并此更改后，需要执行 `./launcher rebuild app` 才能生效。NGINX 配置的更改不会在 UI 更新期间自动应用。

---

_[View the full topic](https://meta.discourse.org/t/all-plugins-not-functioning-due-to-cors-error-after-recent-upgrade/399466)._
