如何在azure web app中配置域/路径重写

如何在azure web app中配置域/路径重写,azure,web,url-rewriting,rules,Azure,Web,Url Rewriting,Rules,好, 我正在尝试在azure web应用程序中从一个路径重写url到另一个域。 我有一个有效的案例,另一个无效 案例1。此案例有效: 我有域A(test.com),我想将请求重写到域B(example.com),在用户在浏览器中看到的URL中保留域A 步骤1:我启用了反向代理: applicationHost.xdt <? xml version = "1.0" encoding = "utf-8"?> <configuration xm

好,

我正在尝试在azure web应用程序中从一个路径重写url到另一个域。 我有一个有效的案例,另一个无效

案例1。此案例有效: 我有域A(test.com),我想将请求重写到域B(example.com),在用户在浏览器中看到的URL中保留域A

步骤1:我启用了反向代理: applicationHost.xdt

<? xml version = "1.0" encoding = "utf-8"?>
<configuration xmlns: xdt = "http://schemas.microsoft.com/XML-Document-Transform">
  <system.webServer>
    <proxy xdt: Transform = "InsertIfMissing" enabled = "true" preserveHostHeader = "false" reverseRewriteHostInResponseHeaders = "false" />
  </system.webServer>
</configuration>

步骤2:创建重写规则 web.config

<rules>
<rule name = "rule 1">
<match url = "(. *)" />
<action type = "Rewrite" url = "https://example.com/" appendQueryString = "true" logRewrittenUrl = "false" />
</rule>
</rules>
<rules>
<rule name = "rule 2">
<match url = "path" />
<action type = "Rewrite" url = "https://example.com/" appendQueryString = "true" logRewrittenUrl = "false" />
</rule>
</rules>

案例2的正确配置是什么

多谢各位