I have a big problem. First the situation: In front I have a SBS2008 SP2 server and all http and https traffic is routed to that server from my router.
I have also a Windows Server 2008 R2 called exact and this server runs a Synergy website and it uses Request.ServerVariables("HTTP_HOST") in its code to construct a URL.
What did I do:
First installed ARR and URL Rewrite
made a website Synergy on the SBS server.
added this rules to the web.config from that site:
(I had to do this on this level, because appliing this rule to higher levels didn't work)
<rewrite>
<rules>
<rule name="All Test" enabled="true" stopProcessing="false">
<match url=".*" />
<action type="Rewrite" url="http://EXACT/synergy/{R:0}" appendQueryString="true" />
<serverVariables>
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="Add application prefix" enabled="true" preCondition="IsHTML">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://exact/synergy/(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" value="{C:1}://mydomain.com/synergy/{R:2}" />
</rule>
<rule name="RelativePad" enabled="true" preCondition="IsHTML">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" />
<action type="Rewrite" value="/{R:1}" />
</rule>
<rule name="RelativePad2" enabled="true" preCondition="IsHTML">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^\./(.*)" />
<action type="Rewrite" value="/synergy/{R:1}" />
</rule>
<preConditions>
<preCondition name="IsHTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
This seems to work fine but when I use Request.ServerVariables("HTTP_HOST") I get the name of the second server "EXACT" and not mydomain.com.
I tried everything, like rules to set this servervariable, nothing works. I working en searching for days on this. I have to solve this.
Please help me!
Kind regards,
Roy