URL Rewrite need to redirect and rewrite URL
HI,
I have an IIS 10 server, URL Rewrite, ARR 3.0, with two tomcat app servers on different servers (appserver1, appserver2). All traffic to my IIS servers must be directed via the URL Rewrite so my matching filter is "(.*)" for all rules.
I want users to be able to:
- go to "https://webserver1.acme.com/application" and hit "https://appserver1.acme.com/application"
- go to "https://webserver1.acme.com/application2" and hit "https://appserver2.acme.com/application"
Here is my rule set:
1)
<rules>
<rule name="Redirect to app server1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{PATH_INFO}" pattern="^/application" />
</conditions>
<action type="Rewrite" url="https://appserver1.acme.com:9443/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
2)
<rules>
<rule name="Redirect to app server2" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{PATH_INFO}" pattern="^/application2" />
</conditions>
<action type="Rewrite" url="https://appserver2.acme.com:9443/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
Doesn't seem to work. Any help? Thank you