Server ip is displayed insted of client ip in sentry logback

Server ip is displayed instead of client ip in Sentry.

sentry raven version : raven-logback:7.8.5

In the ngnix i have set the following headers as

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

Is there any way that we can get the client ip in sentry tags ?

Hi! If you are using the on-premise version of Sentry, SENTRY_USE_X_FORWARDED_FOR is the setting you are looking for. Just set that to True in your file and you should be good. Sorry, we don’t have great docs around that.

That said, be warned that this will allow setting any random IP address by a potentially malicious client so use it at your own risk.

If this is on, please let us know and we may need to investigate it further.

HI @BYK thanks for the quick turnaround.

The issue that i am facing in
Kindly let me know why i am getting the server ip instead of a client ip.

Do we need to set any other proxy header in nginx for sentry ?


Our resident know-it-all expert @matt pointed me here: which seems to have moved to here (docs):

Have you tried that already?

Hi @BYK thanks for the response.

I have migrate raven-java to sentry-java and done the changes which you mentioned in this link

But still i face the same issue. Can you check and let me know your thoughts on this?

1 Like


I am facing the same issue and I’m also using
Kindly let me know a fix for this.

Thanks in advance!