We have two servers in this scenario where one is a web server hosted in a DMZ Zone (on public internet) and another one is an app server which has application code and it is hosted in intranet (non DMZ zone).
Requests are being routed from web server to app server using ARR Module and URL Rewriting module using server farms. So, HTTPS offloading is done on the web server and then requests are routed to internal app server on HTTP with port 80.
Current Setup:
Web Server (IIS):
- Default Web Site with 443 binding i.e. https
- Server Farm (Farm-1) to route the requests using URL rewrite rule
App Server (IIS)
- App Web Site with 80 binding i.e. http
Now, we want to add one more website to the web server and app server for which we have done the following:
New Setup:
Web Server (IIS):
- New Web Site with 8443 binding i.e. https (since 443 is already being used by above web app)
- Created New Server Farm (Farm-2) to route the requests using URL rewrite rule
App Server (IIS)
- New App Web Site with 8080 binding i.e. http (since 80 is already being used by above web app)
URL Rewriting Rules:
<rewrite>
<globalRules>
<clear/>
<rule name="ARR_Farm-1_loadbalance" patternSyntax="Wildcard" stopProcessing="true">
<match url="*"/>
<conditions>
<add input="{SERVER_PORT}" pattern="^443$"/>
</conditions>
<action type="Rewrite" url="http://Farm-1/{R:0}"/>
</rule>
<rule name="ARR_Farm-2_loadbalance" patternSyntax="Wildcard" stopProcessing="true">
<match url="*"/>
<conditions>
<add input="{SERVER_PORT}" pattern="^7443$"/>
</conditions>
<action type="Rewrite" url="http://Farm-2/{R:0}"/>
</rule>
</globalRules>
</rewrite>
I am trying to acheive the below:
- https://www.example.com i.e. 443 port requests should go to Farm-1
- https://www.example.com:7443 i.e. 7443 port requests should go to Farm-2
Tried multiple rewrite rules to acheive the above. Even tried to have the URL rules like:
{URL} pattern matching rules from the below source but it didn't work:
Please help to resolve this as I am stuck from quite a long in this. Any help would be much appreciated !