Views: 4942
Number of votes: 7
Average rating:

Support for ApplicationHost transforms in DXC Service

As of 16th October 2017, Episerver Digital Experience Cloud Service supports ApplicationHost transforms enabling you to modify configuration elements that isn’t exposed in Azure as it was in your IIS management console.

We can create a file named applicationHost.xdt that makes these system configurations as a part of the website configuration ensuring that the settings also get propagated when using automatic scaling.

To make applicationHost transforms in DXC Service you have two options:

  1. The usage of one (1) applicationHost.xdt-file
  2. The usage of environment-specific files, one for each target environment. For example:
  • applicationHost.Preproduction.xdt
  • applicationHost.Production.xdt

Since the DXC deployment engine won’t run the deployment to the Integration environment, you can just add a “applicationHost.xdt” file to that environment if you want to use alternative number 2. We will exclude the applicationHost.xdt file from the code package when moving the deployment to Preproduction/Production environments and apply the environment specific file instead.

Potential use-cases

By utilizing applicationHost transform you can make your Web App in DXC Service to also act as a proxy forwarding requests to another site/web app but replace it with the target URL of your site. Let’s say that you have two sites, one for your external company site (DXC Service) and one for your blog (external) and you want to achieve the following behaviour for your visitors: 

Site 1:
Site 2: (actually using

To achieve this, you need to rewrite and forward all requests for to the location of your blog ( by doing the following in your web app:

  1. Create an applicationHost.xdt and enable proxy.
  2. Add rewriting rules to web.config.
  3. Publish applicationHost.xdt to /site.
  4. Publish web.config changes.

Example of how the rewrite rule in web.config can look:

<rule name="Proxy" stopProcessing="true">
<match url="^blog/?(.*)" />
<action type="Rewrite" url="{R:1}" />

With everything in place our blog will be accessible through instead of using the original address

Note: The forwarded requests will still count as a page view in your DXC Service environment.

2019-06-26 Update regarding Application Insights

Since the addition of Microsoft Azure Application Insights to Episerver Digital Experience Cloud Service, some clients have had issues with the automatic javascript injection causing a conflict with the prior mentioned settings. In many cases by defining the location path parameter as a part of your applicationHost transform as shown below has resolved this conflict. As always everyone’s code is different, and this is just an example to help get you pointed in the right direction.

Example of applicationHost below:

<?xml version="1.0"?>
<configuration xmlns:xdt="">
<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="false" />
<location path="%XDT_SITENAME%" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<rewrite xdt:Transform="InsertIfMissing">
<allowedServerVariables xdt:Transform="InsertIfMissing" >
<add name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" />
<add name="HTTP_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" />

2020-09-23 Update on specific CDN/WAF scenarios

Some scenarios might require further configuration of the CDN layer (ie. when both sites are using Cloudflare) since it can otherwise trigger WAF rules. One solution to avoid this is to disable the WAF. If you're running Episerver DXP + CloudFlare this would require a WAF-disable agreement as it would bypass some of the built-in security features in DXP.

Nov 08, 2017

( 11/15/2017 2:49:10 AM)

Hi David!

Thanks for a good post. The reverse proxy case is actually something that we could use for a customer. Do you know if someone has managed to implement this fully as a reverse proxy, so that both incoming requests but also outgoing links are generated to change the URL? The reason that I am asking is that I have a cusomer that has a lot of web sites, and they would like to change from using sub domains ( to using the main site with a suffix (

Erik Henningson
( By Erik Henningson, 12/5/2017 10:20:38 AM)

Hello there. Did I understand it right that I just have to add the .xdt-file to the "site"-folder on Integration, and then that file will be automatically copied to the other environments?

David Buö
( By David Buö, 12/5/2017 2:12:11 PM)


@Linus Ekström: Thanks! I think thats a great question for our support (they have more knowlegde than me about what has been done or not). I would also recommended you to talk through your scenario with them to make sure its feasible within the service.

@Erik Henningston: Yes that's correct!

( 12/15/2017 1:35:49 PM)

@Linus: Outbound rules works. I've done some smaller changes in the response using outbound rules during troubleshooting of a reverse proxy in DXC S

David Buö
( By David Buö, 6/27/2019 2:30:33 PM)

Updated the post 2019-06-26

Scott Reed
( By Scott Reed, 9/8/2020 8:43:47 PM)

Hi I was sent this article by Episerver supprt to do exactly this scenario but I didn't know what "Create an applicationHost.xdt and enable proxy." meant. Can you provide an example of your xdt file as I don't know what enabling the proxy looks like

Please login to comment.