Dear all,
I've been trying to setup the usual reverse proxy scenario with IIS 8.5, ARR 3.0 and URL Rewrite 2.0:
site.public.com resolving into the IIS ARR server
site.public.com/App1 redirecting into an internal backend web server app1.internal.com
site.public.com/App2 redirecting into an internal backend web server app2.internal.com
I've followed great tutorials
here and
here and
there, got something almost working, but some contents is not correctly rewritten, resulting in a web page being partially displayed for App1 and a basic authentication loop/failure for App2.
The config I'm using for inbound rules is:
<rule name="Reverse Proxy to app1" stopProcessing="true"><match url="^app1/(.*)" /><action type="Rewrite" url="https://app1.internal.com/{R:1}" logRewrittenUrl="true" /><serverVariables><set name="ORIGINAL_HOST" value="{HTTP_HOST}" /></serverVariables></rule><rule name="Reverse Proxy to app2" stopProcessing="true"><match url="^app2/(.*)" /><action type="Rewrite" url="https://app2.internal.com/{R:1}" logRewrittenUrl="true" /><serverVariables><set name="ORIGINAL_HOST" value="{HTTP_HOST}" /></serverVariables></rule>
Inbound rules seems to be fine.
Outbound are mostly causing my troubles. As for outbound rules, I did try a few alternatives, following the tutorials mentioned above, none of them worked as expected.
The only way I could get at least one of the website to be available, was by using for either of them:
<outboundRules><rule name="Response Status Update" preCondition="IsHTML" stopProcessing="true"><match serverVariable="RESPONSE_Location" pattern="^/(.*)" /><action type="Rewrite" value="https://public.site.com/app1/{R:1}" /></rule> <preConditions> <preCondition name="IsHTML"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /></preCondition><preCondition name="IsRedirection"><add input="{RESPONSE_STATUS}" pattern="3\d\d" /></preCondition></preConditions> </outboundRules>
With other rules, I was having redirect issue, and the website wouldn't' even be loaded. Now with the basic outbound rule above, it is loading, but only display a part of the website content. The rule is not applied to Javascripts for example. Jquery come
back in public.site.com/assets/... 404 error, instead of public.site.com/app1/assets/...
I did spend time configuring a RP with Apache, which was working rather well but also limiting some javascripts. I tried with ARR as an alternative, but again encounter some difficulties.
Can someone tell me if this is feasible, or if I should simply forget about it and go for the usual Port Forwarding or good old TMG :) ?
Thanks in advance for any help you might provide.