IIS has several websites:
- domain1.com
- a.domain2.com
- b.domain2.com
There is also a TomCat running on
localhost:8087
The challenge is how to expose the TomCat externally as
b.domain2.com
What I did:
- Enabled Proxy in ARR in IIS
Added Reverse Proxy URL Rewrite rules on b.domain2.com
<rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="(.*)" /> <action type="Rewrite" url="http://localhost:8087/{R:1}" /> </rule> </rules> <outboundRules> <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" > <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:8087/(.*)" /> <action type="Rewrite" value="http{R:1}://femiscan.a2itsolutionsllc.com/{R:2}" /> </rule> <preConditions> <preCondition name="ResponseIsHtml1"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> </preCondition> </preConditions> </outboundRules> </rewrite>
What I see:
Locally if I navigate to
http://b.domain2.com
my browser shows TomCat website as
http://localhost:8087
(Why?)
Externally if I navigate in Chrome to
http://b.domain2.com
it tries to tunnel to
http://localhost:8087
If I navigate in IE it returns 500 error (Fiddler: HTTP/1.1 500 URL Rewrite Module Error.)
Question: What am I doing wrong? Can it be done and how?