如何将基于browserHistory的React应用程序部署到Azure应用程序服务?

如何将基于browserHistory的React应用程序部署到Azure应用程序服务?,azure,iis,reactjs,azure-web-app-service,Azure,Iis,Reactjs,Azure Web App Service,我正在将React应用程序部署到Azure应用程序服务,该服务使用非散列URL(例如browserHistory),如 但是对于所有路径,都应该由相同的index.html来处理。您如何在Azure应用程序服务中实现这一点?基本上,我希望针对应用程序服务的所有请求都映射到/index.html,并让React解决。在部署到Azure应用程序服务的应用程序根目录中添加一个web.config文件: <?xml version="1.0" encoding="utf-8" ?> <

我正在将React应用程序部署到Azure应用程序服务,该服务使用非散列URL(例如browserHistory),如


但是对于所有路径,都应该由相同的index.html来处理。您如何在Azure应用程序服务中实现这一点?基本上,我希望针对应用程序服务的所有请求都映射到/index.html,并让React解决。

在部署到Azure应用程序服务的应用程序根目录中添加一个web.config文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
       <rule name="redirect all requests" stopProcessing="true">
           <match url="^(.*)$" ignoreCase="false" />
           <conditions logicalGrouping="MatchAll">
               <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
           </conditions>
           <action type="Rewrite" url="/index.html" appendQueryString="true" />
       </rule>
     </rules>
   </rewrite>
  </system.webServer>
</configuration>

您是否看到此问题有任何进展。想知道在azure上部署reactJS redux(也是browserHistory)应用程序的详细过程。我的后端在azure功能中。所以我想部署一个静态站点应用程序。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
       <rule name="redirect all requests" stopProcessing="true">
           <match url="^(.*)$" ignoreCase="false" />
           <conditions logicalGrouping="MatchAll">
               <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
           </conditions>
           <action type="Rewrite" url="/index.html" appendQueryString="true" />
       </rule>
     </rules>
   </rewrite>
  </system.webServer>
</configuration>