Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Visitor Groups criteria with load balanced env

$
0
0

Hello

We use episerver CMS site 10.5 version. 

There are configured visitor groups criteria content (user IP criteria) - block with settings which are used in custom frontend widget (some booking widget).

So users from different Ip's see different settings. It works fine on our DEV env. But on PROD a load balancer (AWS hosting) is configured.

We have several versions of Web.config and transformations. On Web.Production.config is set specific parameter to use header for load balanced configurations:  

<appSettings>
<add key="episerver:ClientIPAddressHeader" value="X-Forwarded-For" xdt:Transform="InsertIfMissing" xdt:Locator="Match(key)"/>
</appSettings>

Also custom episerver Ip resolver was injected:

ClientIpAddressResolver : IClientIPAddressResolver

I added to the custom IP resolver traces and logging and see that method ResolveAddress returns correct IP address of user (not a load balancer IP) even on PROD site.

Also tried to define explicitly header with 'right' Ip address on Custom Ip resolver (to exclude version that web.config is not affects): 

private const string HeaderName = "X-Forwarded-For";

But visitor group content still not working. 

Another version is a caching on hosting side but AWS support says that there is no specific cache for PROD site. 


Viewing all articles
Browse latest Browse all 9076

Trending Articles