# All IPs recorded as 127.0.0.1

**URL:** https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135
**Category:** Self-hosting
**Created:** [6월 7, 2017, 10:56오후 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135 "2017-06-07T22:56:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rohmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rohmann/32/120852_2.png) [@rohmann](https://meta.discourse.org/u/rohmann)
#### Post date: [6월 7, 2017, 10:56오후 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/1 "2017-06-07T22:56:17Z")

</div>

I’m having an issue where all my user IPs are recorded as `127.0.0.1`

Been reading some related topics, and still can’t quite figure out what’s going on:.

1. I’m using nginx as a reverse proxy on a separate server.
2. I’ve added this to my container’s nginx configuration: `set_real_ip_from 123.123.123.123;` (Using IP of front end proxy)
3. The nginx `access.log` inside the container shows the correct visitor IP
4. Discourse `production.log` shows `127.0.0.1` for all requests

Any ideas as to why the application isn’t picking up the real IP? Thanks!

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [6월 8, 2017, 6:13오전 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/2 "2017-06-08T06:13:08Z")

</div>

> [@rohmann](#):
>
> Any ideas as to why the application isn’t picking up the real IP?

Because the Discourse nginx is misconfigured, or the upstream proxy isn’t sending the appropriate headers to pass on the forwarded IP address. Without seeing the innards of your config, it’s impossible to know for sure.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [6월 8, 2017, 8:56오전 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/3 "2017-06-08T08:56:10Z")

</div>

I also noticed that I have a very limited range of Screened IPs (see screenshot below), so I wonder whether this points to a similar misconfiguration? The IPs of my users (registration, last IP address) are shown correctly, though. (But when people sign up via invite, their registration IP is not logged. I’m assuming that is by design.)

Why/when exactly do IPs get on the watchlist?

 ![](https://global.discourse-cdn.com/meta/original/3X/9/0/90689d907f34befaa8fb77cab5e0559b7451e4e9.png)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [6월 8, 2017, 9:31오전 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/4 "2017-06-08T09:31:50Z")

</div>

> [@tophee](#):
>
> Why/when exactly do IPs get on the watchlist?

When you delete a user and say “ban IP”. You’re looking at what appears to be the default list. You either have a new site, never had a spam attack, or both.

---

<div class="post-metadata">

### Author: ![rohmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rohmann/32/120852_2.png) [@rohmann](https://meta.discourse.org/u/rohmann)
#### Post date: [6월 8, 2017, 3:25오후 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/5 "2017-06-08T15:25:22Z")

</div>

Got it working! I had followed this guide, but didn’t realize I should have taken out the replace command for the Fastly CDN

> [@Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/subfolder-support-with-docker/30507):
>
> warning Discourse Official Statement about Subfolder setup We support subfolder setups for our hosted customers at the enterprise level and up. Due to heavy technical setup complexity we strongly recommend you do not use this setup unless you are very experienced in custom subfolder setups. It is critical you have a deep understanding of NGINX setup in the Discourse Docker container Secure original IP forwarding using custom headers in the proxy chain Rate limiting in front proxy server I…

I also added this to my container `app.yml` so it would recognize my upstream proxy.

```plaintext
- replace:
       filename: /etc/nginx/conf.d/discourse.conf
       from: keepalive_timeout 65;
       to: |
          keepalive_timeout 65;
          set_real_ip_from [proxy IP];

```

---

<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: [6월 16, 2019, 11:45오전 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/6 "2019-06-16T11:45:41Z")

</div>



---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [6월 16, 2019, 7:02오후 UTC](https://meta.discourse.org/t/all-ips-recorded-as-127-0-0-1/64135/7 "2019-06-16T19:02:40Z")

</div>


