【问题标题】:Error in Node.js with Azure web app serviceAzure Web 应用服务的 Node.js 错误
【发布时间】:2019-01-25 03:43:53
【问题描述】:

我是 Node.js 的新手,我在 node.js 中创建了一个基本应用程序并尝试在 Azure Web App 服务上进行部署。

成功部署后,当我尝试访问一个网站时,它向我显示两种类型的错误,例如 您无权查看此目录或页面。网站没有响应

在这两种情况下,当我尝试跟踪日志时,它都会在您可以尝试的事情中显示跟踪日志

  1. 如果您不想启用目录浏览,请确保配置了默认文档并且该文件存在。
  2. 使用 IIS 管理器启用目录浏览。
  3. 打开 IIS 管理器。
  4. 在功能视图中,双击目录浏览。
  5. 在“目录浏览”页面的“操作”窗格中,单击“启用”。
  6. 验证站点或应用程序配置文件中的 configuration/system.webServer/directoryBrowse@enabled 属性是否设置为 true。

我该如何解决这个错误?

【问题讨论】:

    标签: node.js azure web permissions directory


    【解决方案1】:

    你可以试试这个方法:-

    • 在应用目录的根目录下创建一个web.config 文件。
    • 将以下代码添加到web.config

    <configuration>
      <system.webServer>
        
        <!-- indicates that the index.js file is a node.js application 
        to be handled by the iisnode module -->
        
        <handlers>
          <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
        </handlers>
        
        <!-- adds index.js to the default document list to allow 
        URLs that only specify the application root location, 
        e.g. http://mysite.antarescloud.com/ -->
        
        <defaultDocument enabled="true">
          <files>
            <add value="index.js" />
          </files>
        </defaultDocument>
        
      </system.webServer>
    </configuration>

    希望对您有所帮助。您可以尝试启用 customerror=off 来排除确切的错误。参考请遵循: Azure website message "You do not have permission to view this directory or page.". What to do?

    MV

    【讨论】:

      猜你喜欢
      • 2020-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 2017-05-10
      • 1970-01-01
      • 2017-01-16
      相关资源
      最近更新 更多