How to make #Episerver #visitorgroups work behind a CDN

There is two way to make the IP come from the actual client instead of the CDN edge server. Here is a guide.

Published 25th November 2016

Sometimes when you google or duckduckgo to find the solution, you don‘t always find the best practice way at first, or you may also find an old blog post and since you are eager to get it working, you don’t take your time to seek for alternate way.  So If you found your way here I will describe two ways to make it work.

“In Content Delivery Networks (CDNs), requests to the web server often come from an edge server and not from the actual client; therefore the HttpContext.Request.UserHostAddress property reflects the edge server’s IP address rather than the connecting client’s.” – Epi Documentation

Best practice, the Episerver way as it meant to be done:

In the CDN panel you may choose a name for the header variable that the client ip should be using, or for example Akamai is using custom header variable True-Client-IP. Then change this appsetting to make it work for visitorgroups.

Header X-Forwarded-For is supported by most CDNs, this header contains a comma separated list of IP addresses, one for each CDN/proxy that a request passes through. This header is supported by using the same setting.

It is possible to specify the number of CDNs/proxies the header is expected to contain. Default value is 1, change this value if more than one CDN or proxy is used.


The IIS Url Rewrite way:

Since it sometime differs how many proxies the user is going thru (or you don’t know), this is a way to change HttpContext.Request.UserHostAddress eg ServerVariables[“REMOTE_ADDR”] from the first IP in the IP list in ServerVariables[“HTTP_X_FORWARDED_FOR”].

After installing you have this icon in IIS on the site.
After installing you have this icon in IIS on the site.

First install Url Rewrite to your IIS –

URL Rewrite allows Web administrators to easily build powerful rules using rewrite providers written in .NET, regular expression pattern matching, and wildcard mapping to examine information in both URLs and other HTTP headers and IIS server variables.


manageservervariablesYou may put up rules in the IIS UI, but the most important to make it work is to “Manage Server Variables” and Allow to manipulate them, Add REMOTE_ADDR and HTTP_X_FORWARDED_FOR.


Adding the variable is only done in IIS UI, but the rules are editable in the Web.config, looking like this.

To test this, there is several add ons to you favorite browser to download to simulate and test this before putting it in production.



What’s new in #Episerver 10 (for web editors)

Episerver CMS version 10 is since October 2016 available for download, with a dozen tech breaking changes, but what news is there for editors?

Published 6th November 2016
Last update [4th May 2017 *News*]

So what’s in it for the editor?

Hold your hat! Well none

Wait, what?

No, not if you’re going from late version of 9 to 10, only some changes happens under the hood.


The major versioning system is more a technical thing rather than a market communication event type of thing. The up versioning from 9 to 10 is pointing out that there are incompatible API changes that are needed for the developers to address.

New tech stuff with CMS 10 that might be of interest for editors:

  • Pages that expired, is not redirecting to login page, it’s handled like a 404 Not Found. Great!
  • All dates are saved in UTC (Coordinated Universal Time) in the database. Good for those who publish site pages in a multinational context.
  • Well, not so much more, even if there are more than 50 changes.
  • *New release* [7th November 2016] Episerver Social is released. A cloud based addon for simplifying and standardizing commenting, rating, groups, moderation and activity stream. And no there is for the moment no web editor ui “built in”.
  • *New release* [14th November 2016] Content approvals (beta) This is the first release of the Content Approvals feature, which enables administrators to set up approval sequences containing a number of steps that editors have to collaborate on and approve to be able to publish the content. *Beta is removed in version 10.8*
  • *New release* [5th December 2016] Assets Pane: Handle multiple assets
    The assets pane can now handle multiple selection of folders and items (version 10.2)
  • *New release* [12th December 2016] Projects enabled by default Project mode will now be enabled by default (version 10.2)
  • *news* [April 2017] Add query string parameters to internal links (version 10.7)
  • *news* [April 2017] Import/export refinements (version 10.)
  • *news* [April 2017] Carts – new cart system support in Commerce Manager (version 10.4)

Still reading?

Okey, I’ll give you some old news, here is a summarized feature list from the first version of CMS 9 to CMS 10: (June 2015 – October 2016)

  • Episerver Projects is released and is a great feature when publishing/updating a bunch of pages in a project. With collaboration activity feed and commenting.
  • Episerver Forms is now mature in v4 (only for MVC sites) with marketing automation connectors
  • Rebranded UI interface, from colorful to more red tones, accordingly to Episerver branding profile.
  • New User notifications API – (the small bell up right corner)
  • For Commerce: New Campaign and Discount system, Improved order management and Inventory management in new Cataloge UI.
  • A couple of Market Automation Addons released.

Some statistics of Episerver 9 (dev related):

  • New CMS features : 41
  • CMS bug fixes: 221
  • New Commerce features: 42
  • Commerce bug fixes: 269
  • New features “Other Episerver AddOns” (mostly Forms): 35
  • Bug fixes “Other Episerver AddOns” (mostly Forms): 69

So, alot´s going on, hope to see more news at Ascend Nordic 2016, see you there!

Developers out there, let me know if I missed anything! Comment! Cheers.



  • [15th November 2016 – Episerver Social]
  • [25th November 2016 – Content Approvals]
  • [14th February 2017 – Assets Pane & Projects enabled by default]
  • [4th Mai 2017 – Querystring, carts, import]