# 停止 Discourse 在预加载链接/资源时泄露其主机 IP 地址

**URL:** <https://meta.discourse.org/t/stop-discourse-leaking-its-host-ip-adress-when-preloading-links-ressources/399012>\
**Category:** Self-hosting\
**Created:** [2026年三月22日 23:58 UTC](https://meta.discourse.org/t/stop-discourse-leaking-its-host-ip-adress-when-preloading-links-ressources/399012 "2026-03-22T23:58:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Yogurt](https://avatars.discourse-cdn.com/v4/letter/y/f0a364/32.png) [@Yogurt](https://meta.discourse.org/u/Yogurt)\
**Post date:** [2026年三月22日 23:58 UTC](https://meta.discourse.org/t/stop-discourse-leaking-its-host-ip-adress-when-preloading-links-ressources/399012/1 "2026-03-22T23:58:12Z")

</div>

我指的是这篇帖子：[Discourse Link previews through a proxy server?](https://meta.discourse.org/t/discourse-link-previews-through-a-proxy-server/72720)

首先，很抱歉重新提及这篇将近十年的旧帖子，但我真的不敢相信只有我一个人对此感到困扰？

我现在已经设法用 Cloudflare 隐藏了我的托管服务器及其 IP 地址，并且在搜索了数小时后，我设法只允许来自 Cloudflare 的传入网络流量，这样端口扫描器就不会意外地通过 IP 地址发现论坛。安全对我来说非常重要。邮件服务器是外部的，几乎所有东西都受到了保护——但讽刺的是，任何人只需在帖子中插入一个诱饵图片，Discourse 就会直接下载它以下载并嵌入或其他类似操作。我没有找到任何地方可以禁用此功能。即使是那些应该作为预览的 oneboxes（一键预览）——即使将它们设置为 0 也无济于事——IP 日志记录像素立即被嵌入，可能会向攻击者泄露主机 IP——因此 Cloudflare 的保护在这种情况下完全没用。要么正确保护你的服务，要么干脆不保护——如果攻击者不需要 5 分钟就能注册、发布图片并从而发现主机的真实 IP，那么 Cloudflare 对我们有什么用呢？

我今天花了几个小时尝试使用 AI、tor 和 torsocks——但它从来没有真正奏效。每当我尝试更改 env（环境变量）设置时，重新构建通常就会崩溃。如果有人设法做到了这一点，我几乎是在恳求他们与我们分享。大多数时候，重新构建会失败，因为无法访问 Github，因为 Github 可能禁止 Tor 流量。

如果可以简单地禁用 Discourse 提前加载链接，所有这一切本不必发生。

我真的很绝望。

---

_[View the full topic](https://meta.discourse.org/t/stop-discourse-leaking-its-host-ip-adress-when-preloading-links-ressources/399012)._
