# Nice to know, but did anybody implement this?

**URL:** <https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic\
**Created:** [May 1, 2023, 6:56pm UTC](https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540 "2023-05-01T18:56:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [May 1, 2023, 6:56pm UTC](https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540/1 "2023-05-01T18:56:08Z")

</div>

Hello all,

In the documentation:

> **[Define applications for Real User Monitoring Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/web-applications/initial-setup/define-your-applications-via-the-my-web-application-placeholder)**
>
> Learn how to define your applications following the suggested, manual, or application detection rules approach.

You can read that when the host name is rewritten by a&nbsp; proxy or load balancer the&nbsp;[X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host)&nbsp;or&nbsp;[Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded)&nbsp;header can be used by oneAgent.

- I assume that the detection rule and the&nbsp; of the original host/domain can be used is this correct?

- The cookie set by oneAgent will contain original host/domain tp prevent CORS issue’s

- If you have original and rewritten, put the rewritten detection rule first?

Who has tested this in practice? And does this really work? It sounds like magic (-;

KR Henk

---

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [May 4, 2023, 7:36am UTC](https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540/2 "2023-05-04T07:36:49Z")

</div>

Hello,

It becomes a nice to know (-;

Found more info, there are options in dynatrace to use&nbsp; information in “request headers” to modify the Hostname and/or IP from the source:

 ![henk_stobbe_0-1683185733109.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/a/da988b1a18947fb19f529206506fa95af4f1309a.png)

KR Henk

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [May 4, 2023, 10:35am UTC](https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540/3 "2023-05-04T10:35:56Z")

</div>

Hello.

> [@henk\_stobbe](https://community.dynatrace.com/user/11427)&nbsp;wrote:
> 
> …
> 
> - I assume that the detection rule and the&nbsp; of the original host/domain can be used is this correct?
> 
> - If you have original and rewritten, put the rewritten detection rule first?
> 
> …

As I understand this we need only one rule - that contains&nbsp;original host/domain.

If JS agent can’t define application URL - in this case JS agent will try to find value in:  
X-Host, X-Forwarded-Host, YOUR-TEAM-CUSTOM-HEADER

If JS agent can define without this headers - rules will work - so application detection rule for&nbsp;original host/domain - will work. If can’t - and headers were added - again will work rule that contain original “host/domain”.

We faced this when HTTP2 is using - there is no header “host” in this case.&nbsp; You can check - if you will see in DevTools something like this in request headers (&nbsp;:authority: )

One case was to ask Customer don’t block request header **origin** \ request header - **host**. After this&nbsp;JS agent in our case define application URL correclty without additional headers.

Another case was to ask put correct info in X-Host, X-Forwarded-Host. Also rules works that contain original “host/domain”.

Anyway for all of these cases - it will take time to troubleshoot. Also in such situations additional logs on web server helps, which can locate “client request headers”, because in our case Customer team said that there is no PROBLEM on load-balancers and firewalls and REQUEST HEADERS are set by browser on client side, but when we try to check the logs on last web server in the chain - customer has gotten “many surprises”.

Unfortunately, the Customer team could not do anything with it, so we created a separate environment for this application and rename Defaul RUM Application\ My Web Application.

All such difficult cases were successfully resolved by Dynatrace Support Team.

Big thanks to&nbsp;Shahin Mikayilov 😉

In these cases, I would ask the Сustomer for extended logs, all the necessary and helpful information and would ask&nbsp; support for help. This could really save a lot of time.

Regards,

Alex Romanenkov

---

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [May 9, 2023, 1:36pm UTC](https://community.dynatrace.com/t/nice-to-know-but-did-anybody-implement-this/39540/4 "2023-05-09T13:36:07Z")

</div>

Reading all comments, in short:

1) The browser sends a request to the server (including oneAgent)

2) Server/Onegent try to determine what domain can be found in the request.

3) A set-cookie is send back with a manually set defined domain, or the found domain in the request (rule based), or the OneAgent server domain itself.

4) This cookie domain is further&nbsp; used in the session
