我一直在使用ARR和重写规则来轻松访问我的Tomcat应用程序。两个使用相同端口的tomcat服务器,为iis重写规则
如果应用程序在运行像:http://localhost:8090/alfresco
重写规则后,它可以访问:http://localhost/alfresco
这是我一直在使用,工程完美重写规则的例子:
<rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
<match url="(alfresco.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(http?)://" />
</conditions>
<action type="Rewrite" url="{C:1}://localhost:8090/{R:1}" />
</rule>
现在我面对的问题是,我有另一个本地服务器,它有这个相同的tomcat应用程序的名称和端口。现在,我想开发一个重写规则,这样,当我访问:http://localhost/alfresco1
应该带我到那个服务器,网址是:http://172.23.1.168:8090/alfresco
是否有任何理由在重写中使用反向引用?我的观点是,'alfresco'是'http:// localhost:8090/alfresco'和'http://172.23.1.168:8090/alfresco'中的一个常量? – cheesemacfly
这是您看到运行的tomcat应用程序名为'alfresco'的主要问题。我上面创建的规则是与名称“alfresco”匹配的网址。所以如果我为'172.23.1.168'创建另一个规则并将其写入规则而不是'localhost',那么仍然会将我带到'172.23.1.168/alfresco'之外的'localhost'。因为它们都具有相同的URL匹配。 – user1788171