HttpRedirect Не работает с узлом IIS Web.Config в приложении Azure - PullRequest
0 голосов
/ 16 декабря 2018

Я пытаюсь запустить экспресс-приложение на Azure.Я хочу настроить перенаправление с помощью выражений регулярных выражений в web.config.Но когда я попробую этот URL.он не перенаправляет.Express переопределяет конфигурации сервера IIS.Можно ли обслуживать статические файлы, а также nodejs со всем перенаправлением, обработанным IIS.

Пример кода из моего web.config здесь:

   <handlers>
  <!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
  <add name="iisnode" path="bin/www" verb="*" modules="iisnode" />
 </handlers>
  <httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found">

  <add wildcard="*ABC" destination="https://example.com/dir1/ABC/" />

</httpRedirect>
    <rewrite>
  <rules>
    <!-- Do not interfere with requests for node-inspector debugging -->
    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^bin/www\/debug[\/]?" />
    </rule>

    <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
    <rule name="StaticContent">
        <match url=".*" />
        <conditions>
          <add input="{StaticRedirects:{PATH_INFO}}" pattern="(.+)" />
        </conditions>
        <action type="Redirect" url="{C:1}" appendQueryString="true" redirectType="Permanent" />
    </rule> 

    <!-- All other URLs are mapped to the node.js site entry point -->
   <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      </conditions>
      <action type="Rewrite" url="bin/www" />
    </rule> 
  </rules>

</rewrite>
...