将某些API请求从一个Web应用程序重定向到另一个Web应用程序>>

问题描述 投票:1回答:3

我有两个Azure Web App。我想配置一些API请求从一个Web应用程序到另一个Web应用程序的重定向。来自/ api / v1 / resources的所有请求都应该发送到webapp2,来自webapp1上的示例/ api的所有其他请求都将保留在Web应用程序webapp1上。

<rewrite>
        <rules>
          <rule name="[RULE NAME]" stopProcessing="true">
            <match url="(.*)" />
            <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                <add input="{HTTP_HOST}{REQUEST_URI}" pattern="https://webapp1.test.net/api/v1/resources" />
            </conditions>
            <action type="Redirect" url="https://webapp2.test.net/{R:0}" redirectType="Permanent"/>
          </rule>
        </rules>
    </rewrite>

但是我的重定向不起作用。

我有两个Azure Web App。我想配置一些API请求从一个Web应用程序到另一个Web应用程序的重定向。到达/ api / v1 / resources的所有请求都应转到webapp2,所有其他请求都应到达...

azure iis azure-web-sites
3个回答
0
投票

Webconfig中带有标签<rewrite>的设置在IIS和VS调试中有效。


0
投票

仅因为{HTTP_HOST} {REQUEST_URI}不包含https://。


0
投票

我找到答案:

© www.soinside.com 2019 - 2024. All rights reserved.