简体   繁体   English

带有Azure Web应用程序服务的Node.js中的错误

[英]Error in Node.js with Azure web app service

I am new to Node.js and I have created a basic application in node.js and trying to deploy on Azure web App service. 我是Node.js的新手,并且已经在node.js中创建了一个基本应用程序,并尝试在Azure Web App服务上进行部署。

After successful deployment, when I am trying to hit a website it showing me two types of error like You do not have permission to view this directory or page. 成功部署后,当我尝试访问一个网站时,它向我显示两种错误,例如您无权查看此目录或页面。 or website not responding . 网站没有反应

In both cases, when I tried to trace the logs, it shows me following logs in the things you can try 在这两种情况下,当我尝试跟踪日志时,它都会向您显示可以尝试的日志

  1. If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists. 如果您不想启用目录浏览,请确保配置了默认文档并且该文件存在。
  2. Enable directory browsing using IIS Manager. 使用IIS管理器启用目录浏览。
  3. Open IIS Manager. 打开IIS管理器。
  4. In the Features view, double-click Directory Browsing. 在“功能”视图中,双击“目录浏览”。
  5. On the Directory Browsing page, in the Actions pane, click Enable. 在“目录浏览”页上的“操作”窗格中,单击“启用”。
  6. Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file. 验证站点或应用程序配置文件中的configuration/system.webServer/directoryBrowse@enabled属性是否设置为true。

How can I resolve the error? 我该如何解决该错误?

You can try this approach:- 您可以尝试这种方法:-

  • Create a web.config file at the root of the app directory. 在应用目录的根目录下创建一个web.config文件。
  • Add the following code to 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, eg http://mysite.antarescloud.com/ --> <defaultDocument enabled="true"> <files> <add value="index.js" /> </files> </defaultDocument> </system.webServer> </configuration> 

Hope it helps. 希望能帮助到你。 You can try enabling customerror=off to for troubleshooting exact error.For reference please follow: Azure website message "You do not have permission to view this directory or page.". 您可以尝试启用customerror = off来对确切的错误进行故障排除。有关参考,请遵循: Azure网站消息“您无权查看此目录或页面。”。 What to do? 该怎么办?

MV MV

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM