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 sentry.conf.py 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 sentry.io, 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 sentry.io.
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 ?

ip2

Our resident know-it-all expert @matt pointed me here: https://github.com/getsentry/sentry-java/commit/c5f9e2d4f0d2fca8b6d54b520c8aa997bbef1fd7 which seems to have moved to here (docs): https://docs.sentry.io/clients/java/config/#custom-functionality

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 https://docs.sentry.io/clients/java/config/#custom-functionality.

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