# 在 Cloudflare 下查看真实 IP 与用户删除

**URL:** <https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844>\
**Category:** Support\
**Created:** [2019年十月12日 14:13 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844 "2019-10-12T14:13:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MentalNomad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalnomad/32/95159_2.png) [@MentalNomad](https://meta.discourse.org/u/MentalNomad)\
**Post date:** [2019年十月12日 14:13 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844/1 "2019-10-12T14:13:43Z")

</div>

是否有设置可以在删除用户时禁用 IP 封禁？

默认行为是在删除用户时封禁其 IP，但由于我们使用了 Cloudflare，这实际上只是封禁了 Cloudflare IP 范围内的某个随机 IP，从而导致其他用户无法访问网站。

我们希望禁用此行为。

---

<div class="post-metadata">

**Author:** ![DNSTARS](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnstars/32/100957_2.png) [@DNSTARS](https://meta.discourse.org/u/DNSTARS)\
**Post date:** [2019年十月12日 16:32 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844/2 "2019-10-12T16:32:17Z")

</div>

> [@True user IPs when using Cloudflare](https://meta.discourse.org/t/true-user-ips-when-using-cloudflare/120707/2):
>
> Cloudflare acts as a proxy between your users and your server, which means the default configuration will show Cloudflare nodes rather than origin IPs. You need to add the Cloudflare template to your app.yml so that you can see the true originating IP of your users. Under templates: add: - "templates/cloudflare.template.yml" Then rebuild.

供参考，如有需要。

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2019年十月12日 16:59 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844/3 "2019-10-12T16:59:11Z")

</div>

不使用上述模板使用 Cloudflare 将完全不受支持。

已更新标题，因为这并非用户删除问题，而是一个简单的配置问题。您只需在 YML 文件中添加 Cloudflare 模板并重新构建即可解决。

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年六月15日 22:58 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844/4 "2023-06-15T22:58:41Z")

</div>



---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2023年六月16日 01:47 UTC](https://meta.discourse.org/t/seeing-true-ip-with-cloudflare-and-user-deletion/130844/5 "2023-06-16T01:47:58Z")

</div>


