【发布时间】:2019-06-02 18:21:49
【问题描述】:
我已成功在 azure 中部署 nodejs 应用程序。当我导航到 **https://my-app/xyz ** 刷新页面时,我看到,您无权查看此目录或页面。
我尝试编辑 web-config,但仍然无法正常工作。我不确定这是安全问题还是 node.js 无法为这条路线提供任何服务,但在我的本地机器上如果我刷新它不会显示这个问题。上图包含目录结构,/client 有 Angular 编译文件。谢谢
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteRules" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
【问题讨论】:
-
我会试试这个 Tony 并尽快告诉你它是否有效。谢谢你:)
-
您对这个问题有任何更新吗?
-
我目前正在研究它