# How to fix all traffic showing as coming from Cloudflare servers instead of the user's browser IP

**URL:** https://meta.discourse.org/t/cloudflare-ip/399954
**Category:** Support
**Tags:** unsupported-install, cloudflare
**Created:** [April 4, 2026, 6:56pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954 "2026-04-04T18:56:20Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 4, 2026, 6:56pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/1 "2026-04-04T18:56:21Z")

</div>

When deploying Discourse in a 1Panel container with a reverse proxy and using Cloudflare CDN for the domain, how can I resolve the issue where all traffic appears to originate from Cloudflare’s servers instead of the users’ actual browser IP addresses?

---

<div class="post-metadata">

### Author: ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)
#### Post date: [April 4, 2026, 7:04pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/2 "2026-04-04T19:04:44Z")

</div>

You want to use the [Cloudflare template](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405) in your app.yml.

> [@Using Discourse with Cloudflare: Best Practices](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405/1):
>
> ## Additional configuration for self-hosted installations
> 
> To ensure correct IP address forwarding, add the following to the templates section in your `containers/app.yml`:
> 
> ```plaintext
> - "templates/cloudflare.template.yml"
> 
> ```

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 4, 2026, 7:08pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/3 "2026-04-04T19:08:57Z")

</div>

Tried it, but it didn’t work 🤣. The failure might be because I deployed it using a 1panel container and used a reverse proxy?

---

<div class="post-metadata">

### Author: ![ProxyTracer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/proxytracer/32/549480_2.png) [@ProxyTracer](https://meta.discourse.org/u/ProxyTracer)
#### Post date: [April 4, 2026, 11:00pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/4 "2026-04-04T23:00:02Z")

</div>

Can you edit the nginx configuration file directly? If so, make the changes suggested [here](https://github.com/proxytracer/discourse-proxytracer/?#multi-layer-proxy-architecture-cloudflare--local-reverse-proxy). And now after reloading the nginx service it should be working. Hope this helps!

---

<div class="post-metadata">

### Author: ![LotusJeff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lotusjeff/32/477888_2.png) [@LotusJeff](https://meta.discourse.org/u/LotusJeff)
#### Post date: [April 5, 2026, 2:24am UTC](https://meta.discourse.org/t/cloudflare-ip/399954/5 "2026-04-05T02:24:02Z")

</div>

Curious on the reasons for running 2 reverse proxies? One at the hosting company and CloudFlare. Is there a technical reason?

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 5, 2026, 3:13am UTC](https://meta.discourse.org/t/cloudflare-ip/399954/6 "2026-04-05T03:13:24Z")

</div>

I deployed Discourse using containers via the 1Panel server management panel (open-source) for convenient server management.

The 1Panel architecture is: `User -> Cloudflare -> 1Panel Nginx -> Discourse container`.

My understanding is that even if I modify the app.yml configuration in Discourse, 1Panel’s Nginx still sits between Cloudflare and Discourse.

---

<div class="post-metadata">

### Author: ![LotusJeff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lotusjeff/32/477888_2.png) [@LotusJeff](https://meta.discourse.org/u/LotusJeff)
#### Post date: [April 5, 2026, 11:08am UTC](https://meta.discourse.org/t/cloudflare-ip/399954/7 "2026-04-05T11:08:30Z")

</div>

So it is a technical constraint introduced by 1panel.

Are you running multiple servers or only Discourse on the VPS? If you are only running discourse you probably do not need 1panel. Unless, there is a technical reason you need 1 panel.

My discourse is native on a vps behind cloudflare. This setup works.

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 5, 2026, 2:22pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/8 "2026-04-05T14:22:25Z")

</div>

Besides Discourse, there’s also OpenClaw 😀

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 7, 2026, 4:48pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/9 "2026-04-07T16:48:59Z")

</div>

> [@sniper756](#):
>
> The failure might be because I deployed it using a 1panel container and used a reverse proxy?

Almost certainly.

Is the IP you’re seeing teh 1panel container IP?

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 8, 2026, 2:52pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/10 "2026-04-08T14:52:08Z")

</div>

When viewing users as an administrator, the last used IP address displayed is a Cloudflare IP address.

---

<div class="post-metadata">

### Author: ![LotusJeff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lotusjeff/32/477888_2.png) [@LotusJeff](https://meta.discourse.org/u/LotusJeff)
#### Post date: [April 9, 2026, 2:43am UTC](https://meta.discourse.org/t/cloudflare-ip/399954/11 "2026-04-09T02:43:57Z")

</div>

Have you implemented this?

[https://support.cpanel.net/hc/en-us/articles/360051107513-How-to-restore-visitors-IP-with-mod-remoteip#:~:text=The%20Apache%20mod\_remoteip%20module%20restores%20the%20original,instead%20of%20the%20original%20visitor’s%20IP%20address](https://support.cpanel.net/hc/en-us/articles/360051107513-How-to-restore-visitors-IP-with-mod-remoteip#:~:text=The%20Apache%20mod_remoteip%20module%20restores%20the%20original,instead%20of%20the%20original%20visitor's%20IP%20address).

This is the fix for Apache to use the end user ip instead of the cloudflare ip address.

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 9, 2026, 4:26am UTC](https://meta.discourse.org/t/cloudflare-ip/399954/12 "2026-04-09T04:26:19Z")

</div>

Thanks, I’m using nginx. I’ve looked up some tutorials that involve configuring the host’s nginx for reverse proxying. I’ll give it a try when I have some time.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 9, 2026, 4:13pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/13 "2026-04-09T16:13:20Z")

</div>

Did you install the cloudflare template as suggested? If not, then why are you asking for help here?

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [April 10, 2026, 4:20pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/14 "2026-04-10T16:20:09Z")

</div>

Cloudflare template? I’ve already modified the yml configuration file and enabled the Cloudflare template. However, I’m deploying Discourse via 1Panel containers (1Panel architecture: User → Cloudflare → 1Panel Nginx → Discourse container). Just changing the yml file isn’t enough; you also need to modify the reverse proxy Nginx configuration file inside 1Panel. I don’t have time right now, so I haven’t gotten around to making those changes yet.

---

<div class="post-metadata">

### Author: ![Lee\_Ars](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee_ars/32/1597_2.png) [@Lee\_Ars](https://meta.discourse.org/u/Lee_Ars)
#### Post date: [April 10, 2026, 7:14pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/15 "2026-04-10T19:14:43Z")

</div>

It sounds like you need to modify 1Panel’s instance of nginx to utilize its [real\_ip functionality](https://nginx.org/en/docs/http/ngx_http_realip_module.html) for user requests. Cloudflare sends along this information with the `CF-Connecting-IP` header, and you can utilize that header to [tell nginx what to do with itself](https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/#nginx-1).

It would likely be worthwhile to build some script-based automation to regularly download cloudflare’s proxy address lists ([ipv4](https://www.cloudflare.com/ips-v4/#), [ipv6](https://www.cloudflare.com/ips-v6/#)) to keep your nginx real\_ip ranges updated.

If you don’t have access to your 1Panel nginx.conf file, you’re probably out of luck. Nginx’s real\_ip + cloudflare’s `CF-Connecting-IP` header is how this problem is intended to be solved if you’re managing your own reverse proxy in front of self-hosted Discourse.

---

<div class="post-metadata">

### Author: ![sniper756](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sniper756/32/545002_2.png) [@sniper756](https://meta.discourse.org/u/sniper756)
#### Post date: [May 1, 2026, 7:48pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/16 "2026-05-01T19:48:10Z")

</div>

Finally had time to resolve this issue. See details below:

[Solved: Discourse deployed via 1Panel shows all user IPs as coming from Cloudflare instead of the user’s real browser IP - Support - Discourse Meta](https://meta.discourse.org/t/1panel-discourse-ip-cloudflare-ip/402038)

---

<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: [May 31, 2026, 7:48pm UTC](https://meta.discourse.org/t/cloudflare-ip/399954/17 "2026-05-31T19:48:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
