Custom Resolution of Client's Originating IP Address
Overview
You can configure which HTTP header Bloomreach Content uses to determine the client's originating IP address.
When to Use
Configure custom IP header resolution when your environment uses a header other than X-Forwarded-For to pass the client’s IP address. This is common when your load balancer or HTTP server sets a custom header.
Common use cases include:
- Enabling HST Page Diagnostics or CMS Diagnostics for specific client IPs.
- Using the GeoIPCollector in the Relevance Module to personalize content based on client location.
Default Behavior
By default, Bloomreach Content checks the X-Forwarded-For HTTP header to determine the client’s IP address. If this header is not present, it falls back to javax.servlet.ServletRequest#getRemoteAddr().
Customizing the IP Header
To use a different HTTP header, set the http-forwarded-for-header parameter in the $CATALINA_BASE/conf/context.xml file.
Example: Using a Custom Header
If your environment provides the client’s IP address in the X-FOO-Forwarded-For header, add the following parameter:
<?xml version='1.0' encoding='utf-8'?> <Context> <!-- SNIP --> <Parameter name="http-forwarded-for-header" value="X-FOO-Forwarded-For" override="false" /> <!-- SNIP --> </Context>
After this change, both the delivery and authoring tiers, as well as the GeoIPCollector, will use the specified header to resolve the client’s IP address.
Multiple Header Support
Note: Starting with brXM v12.2, you can specify multiple header names as a comma-separated list in the
http-forwarded-for-headerparameter.Example:
"X-FOO-Forwarded-For, X-Forwarded-For"
When multiple headers are listed, Bloomreach Content checks each header in order and uses the first one found. This is useful if you deploy across different environments with varying proxy or load balancer configurations.
Verification
After updating the configuration, verify that the application resolves client IP addresses using the intended header(s). Test requests from different client IPs and check diagnostic features or logs to confirm correct behavior.