将Azure子域名应用程序指向另一个IP服务器

时间:2019-01-09 13:47:44

标签: azure record

我有一个使用Azure身份验证的系统,我已经在AD中部署了AD,现在要使用OAuth2,我需要将应用程序托管在同一Azure中。

我已经创建了名称为(testapp.azurewebsites.net)的应用程序,现在该testapp需要指向另一台服务器,因此当我在url中输入时,它应该解析另一个IP并运行该服务器上托管的应用程序。

我没有在AZURE中找到任何东西将此Testapp绑定到A记录IP,有办法吗?

testapp.azurewebsites.net指向192.168.0.12

1 个答案:

答案 0 :(得分:0)

使用重定向

<configuration>
  <system.webServer>  
    <rewrite>  
        <rules>  
          <rule name="Redirect rquests to default azure websites domain" stopProcessing="true">
            <match url="(.*)" />  
            <conditions logicalGrouping="MatchAny">
              <add input="{HTTP_HOST}" pattern="^testapp\.azurewebsites\.net$" />
            </conditions>
            <action type="Redirect" url="http://192.168.0.12/{R:0}" />  
          </rule>  
        </rules>  
    </rewrite>  
  </system.webServer>  
</configuration>  

步骤1

步骤2

步骤3

步骤4

步骤5

步骤6

步骤7

web.config

<configuration>
  <system.webServer>  
    <rewrite>  
        <rules>  
          <rule name="Redirect rquests to default azure websites domain" stopProcessing="true">
            <match url="(.*)" />  
            <conditions logicalGrouping="MatchAny">
              <add input="{HTTP_HOST}" pattern="^yoursite\.azurewebsites\.net$" />
            </conditions>
            <action type="Redirect" url="http://www.yoursite.com/{R:0}" />  
          </rule>  
        </rules>  
    </rewrite>  
  </system.webServer>  
</configuration>  
相关问题