# 代理不再识别真实IP

**URL:** https://meta.discourse.org/t/real-ip-no-longer-recognized-through-proxy/407792
**Category:** Self-hosting
**Created:** [2026年七月16日 13:02 UTC](https://meta.discourse.org/t/real-ip-no-longer-recognized-through-proxy/407792 "2026-07-16T13:02:29Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2026年七月16日 13:02 UTC](https://meta.discourse.org/t/real-ip-no-longer-recognized-through-proxy/407792/1 "2026-07-16T13:02:29Z")

</div>

在过去几个月里（不确定具体从何时开始），我发现我根据 [Add an offline page to display when Discourse is rebuilding or starting up](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238?u=mcdanlj) 文档配置的外部 nginx 设置，用于传递真实 IP 地址的功能，正在被忽略。

这个外部 nginx 配置已经正常工作多年：

```plaintext
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Real-IP $remote_addr;

```

现在我看到所有流量都被归因于 RFC1918 地址空间内的内部 Docker 网络，如下所示：

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/8/7/987dd52f45efc0acf3c2633623d37ad880260006.png)

这显然破坏了“对共享此 IP 地址的其他用户应用此惩罚”以及其他所有依赖真实远程 IP 地址的功能。

我猜想这个问题可能已经在某处得到解决，只是我搜索得不够仔细。☹ 但我非常希望能得到一些提示，告诉我可能发生了哪些变化，以便我能做出相应的调整。

---

_[View the full topic](https://meta.discourse.org/t/real-ip-no-longer-recognized-through-proxy/407792)._
