【发布时间】:2019-08-31 02:01:56
【问题描述】:
我在 Azure blob 存储中托管了一个单页 React 应用,但在深度链接到页面时收到 请求的内容不存在。 错误:
我在存储帐户中启用了静态网站选项:
文件都在 $web 容器中:
这包括以下带有重写规则的 web.config,应该让 index.html 处理所有路由:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
谁能看出我哪里出错了?
【问题讨论】:
标签: asp.net reactjs azure azure-storage