The host portion of the URL is essential for two specific RUM features—applying frontend detection rules and automatically detecting the RUM cookie domain. However, in environments with components like reverse proxies or load balancers, the original host may be rewritten before reaching an instrumented tier using a technology with RUM support. To resolve this, OneAgent provides a host name determination feature.
Components like reverse proxies and load balancers can be configured to forward the original host information to the backend in a request header. Common headers for this purpose include X-Forwarded-Host and the standardized Forwarded header.
OneAgent can retrieve the original host from one of these headers or from any proprietary header that follows the same format as X-Forwarded-Host: <host> for default ports or <host>:<port> otherwise. A comma-separated list of such entries is also supported, with the assumption that the first entry represents the original host name.
Some components add one of these headers by default. If yours does not, you need to configure it to include such a header to use the host name determination feature.
OneAgent uses a list of request headers to determine the host name. Headers in the list are processed in order, with those at the top taking precedence. As soon as OneAgent finds a matching header on the request, it stops evaluating the remaining headers. After confirming that your uninstrumented component adds a suitable header, you might need to add that header to the list.
To configure the headers used for host name determination
Host header, which is included in every HTTP/1.1 request.If the original host name requested by the browser is www.example.com and your uninstrumented reverse proxy forwards the request to an internal host such as backend.com, the original host information is lost. In this case, the proxy must add a header that preserves the original host name to allow OneAgent to determine the original host, as illustrated in the diagram below.
