【问题标题】:refresh page, azure or iis reacts with You do not have permission to view this directory or page刷新页面,azure 或 iis 反应你没有查看此目录或页面的权限
【发布时间】: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 并尽快告诉你它是否有效。谢谢你:)
  • 您对这个问题有任何更新吗?
  • 我目前正在研究它

标签: node.js angular azure


【解决方案1】:

我遇到了这个错误。我想您通过虚拟目录访问该网站。

  • 确保您已为您的应用程序设置了正确的虚拟目录。 应该是虚拟路径/xyz,物理路径site\wwwroot\yourcustomfoldername。会是这样的,
  • 确保物理路径与 KUDU 站点中 Web 应用程序的实际根目录匹配。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-02
    • 2021-01-29
    • 2021-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多