# Cloudflareテンプレートが中間プロキシがあると機能しない

**URL:** <https://meta.discourse.org/t/cloudflare-template-not-working-when-there-is-an-intermediate-proxy/226689>\
**Category:** Self-hosting\
**Created:** [2022 年 5 月 10 日午後 5:08 UTC](https://meta.discourse.org/t/cloudflare-template-not-working-when-there-is-an-intermediate-proxy/226689 "2022-05-10T17:08:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gale](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@gale](https://meta.discourse.org/u/gale)\
**Post date:** [2022 年 5 月 10 日午後 5:08 UTC](https://meta.discourse.org/t/cloudflare-template-not-working-when-there-is-an-intermediate-proxy/226689/1 "2022-05-10T17:08:39Z")

</div>

Cloudflareテンプレートを有効にした後でも、Discourse管理セクションの新規ユーザー登録IPおよび最終アクセスIPにCloudflareのIPアドレスが表示されるのですが、何が起こっているのかよくわかりません。

ランチャーを使用してアプリに入り、`/etc/nginx/conf.d/discourse.conf` ファイルに以下の行が含まれていることを確認しました。

```plaintext
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;
real_ip_header CF-Connecting-IP;

```

しかし、`最終IPアドレス`の値として `172.68.133.64`（上記のIPアドレスに含まれるCloudflareIP）が表示され続け、ログエントリにもCloudflareIPが表示されています。

`service nginx reload` を実行してみましたが、正常に実行されたようですが、CloudflareIPが表示され続けています。

この問題をさらにデバッグしたり、修正したりする方法について、何かアイデアはありますか？

---

_[View the full topic](https://meta.discourse.org/t/cloudflare-template-not-working-when-there-is-an-intermediate-proxy/226689)._
