如何从另一个Web应用程序打开一个Web应用程序

时间:2020-01-09 13:52:04

标签: azure url-rewriting reverse-proxy

我有两个Web应用程序。 1. WebApp-A 2. WebApp-B

这两个网站都已加载了已发布的.NET网站。

虽然我在WebApp-A中打开特定路径(如https://WebApp-A/webapp-b),但应该打开http://webapp-b/

未重定向。只打开内容。不会更改URL。

我试图使用URL重写(反向代理),但未获得实际结果。

<rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="www.webapp-b.com" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://webapp-a/webapp-b(.*)" />
                    <action type="Rewrite" value="http{R:1}://webapp-b/{R:2}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
          </rewrite>

这两个在Azure Web应用程序中。

0 个答案:

没有答案