# Define where to get the End-User IP for Real User Monitoring

**URL:** <https://community.dynatrace.com/t/define-where-to-get-the-end-user-ip-for-real-user-monitoring/20853>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic\
**Created:** [November 19, 2020, 10:29am UTC](https://community.dynatrace.com/t/define-where-to-get-the-end-user-ip-for-real-user-monitoring/20853 "2020-11-19T10:29:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [November 19, 2020, 10:29am UTC](https://community.dynatrace.com/t/define-where-to-get-the-end-user-ip-for-real-user-monitoring/20853/1 "2020-11-19T10:29:11Z")

</div>

Determining the end-user IP for real user monitoring can be challenging. Typically Dynatrace does this by various HTTP headers that can be manually also defined what header to use.

What if this header is unknown? And how could the determination of this header be tweaked. e.g. from where to get the header e.g. on downstream services?

I have this scenario:

A proxy server (actually more than one, varnish, haproxy and nginx) sits in front of an application server. Especially when oneagent (and real user monitoring) is active on the proxy nginx it seems that Dynatrace is ONLY using the ClientIP of this “entry service” to determine the real users client IP. However in my case Dynatrace is not detecting the real client IP on that servis, but it’s detecting the real client IP on the downstream AppServer!

As you can see here:

The client IP on Nginx is detected as an internal IP, likely from the HAProxy or Varnish Cache

 ![27337-screenshot-2020-11-19-at-110744.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/ee1d68cc2b244b89ca36b2834670b89c87617b5c.png)

But the real client IP is passed on to the application server. (Nginx uses X-Real-IP header to pass it on, additionally to the DT auto-detecion I also added a request attribute to capture it)

 ![27368-screenshot-2020-11-19-at-110856.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7535cac7d715cf198852376cdb573ec6e3bdd703.png)

Now, without knowing the nginx or varnish/HAProxy configuration - if any headers have been added to pass on the client IP (I’ve configured all usual subjects of IP headers, X-Forwarded-For, …) - the Real User Monitoring IP is detected as a local one (10.41.0.0) and thus no location info is available.

When I remove the oneagent from nginx, the location detection is based on the appserver IP and works perfectly fine, however I loose visibility into nginx.  
Since Nginx obviously HAS the client IP information somewhere (it couln’t pass it on to the appserver otherwise), how could this be detected and used for location detection?  
The complicated way would be to configure every proxy in the chain to add/pass-on the header, but this is not possible unless you have access to all.

Could there be a way to use the IP from downstream services? Or tell DT in the Applciation configuration to still do RUM injection but if it can’t determine the Client IP try on the downstream service?

Any ideas?

---

_[View the full topic](https://community.dynatrace.com/t/define-where-to-get-the-end-user-ip-for-real-user-monitoring/20853)._
