# Wrong user ip (127.0.0.1)

**URL:** <https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689>\
**Category:** Grafana\
**Tags:** api, plugins\
**Created:** [January 27, 2022, 12:51am UTC](https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689 "2022-01-27T00:51:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josevitor867](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@josevitor867](https://community.grafana.com/u/josevitor867)\
**Post date:** [January 27, 2022, 12:51am UTC](https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689/1 "2022-01-27T00:51:35Z")

</div>

Hi guys, I using grafana 8.1 with nginx (behind reverse proxy).

Why users IP history is equal to 127.0.0.1? How can I fix this to show real user ip? And why is showing 127.0.0.1? I only think about reverse proxy, but I need this to work my company.

I access grafana over (example): [mycompany.com/dashboard](http://mycompany.com/dashboard)

and nginx redirect this link to 127.0.0.1:3000/dashboard

 ![20220126_215238](https://us1.discourse-cdn.com/grafana/original/3X/5/b/5bf7e6dc1010715e3b043787fad439d44f8d8f0b.jpeg)

---

<div class="post-metadata">

**Author:** ![josevitor867](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@josevitor867](https://community.grafana.com/u/josevitor867)\
**Post date:** [January 27, 2022, 7:29pm UTC](https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689/2 "2022-01-27T19:29:42Z")

</div>

any one can help me?

---

<div class="post-metadata">

**Author:** ![pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@pooh](https://community.grafana.com/u/pooh)\
**Post date:** [January 27, 2022, 9:10pm UTC](https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689/3 "2022-01-27T21:10:19Z")

</div>

This is not a question about Grafana, but a question about using a reverse  
proxy.

I am pretty unfamiliar with NginX, but I know that Apache has settings for  
selecting whether the address passed on to the origin server (Grafana) is that  
of the proxy (127.0.0.1 in your case) or that of the client.

The main thing to think about, though, is “how could Grafana reply?”

If you are using a reverse proxy, it is often because the client cannot  
connect directly to the server (whereas it can connect to the proxy, and the  
proxy can connect to the server).

If that is the case, then it’s probably also true that the server cannot  
connect back to the client, so if the server (Grafana) were told the real IP  
address of the client, it would not be able to reply, and the client would  
fail to get a response from Grafana.

You also need to ensure that the IP address from which the client gets a  
response is that same as the address it sent the original request to, so if it  
sends a request to the IP of the reverse proxy and gets a response from the IP  
of Grafana, it still won’t work.

However, given that you say all the requests are from 127.0.0.1, this means  
your reverse proxy is running on the same server as Grafana is, so why are you  
using NginX at all?

Why do your clients not simply connect directly to Grafana, get a response  
from it, and get their real IP addresses logged as a result?

Antony.

---

<div class="post-metadata">

**Author:** ![josevitor867](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@josevitor867](https://community.grafana.com/u/josevitor867)\
**Post date:** [January 27, 2022, 10:58pm UTC](https://community.grafana.com/t/wrong-user-ip-127-0-0-1/59689/4 "2022-01-27T22:58:04Z")

</div>

yes, it’s really proxy problem. I solved writing this inside sites-enabled conf.

{

```auto
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

```

}
