Node.js Azure Web App Windows 500.1001错误

我在Windows上有一个Azure Web应用程序,它运行iisnode与我的Node应用程序进行通信,并得到一个1001的子状态500错误。 似乎IIS似乎没有得到来自Node的响应。 我已经在应用程序设置下设置了NODE_ENV和PORTvariables。 为了最大限度地减less这些variables,我也将其分解到Node Hello World应用程序中。 节点拿起PORTvariables,并启动使用适当的端口,因为我知道,因为我看到std出说明应用程序启动指定的端口。 但是,当我尝试任何请求时,Node永远不会实际接收来自iisnode的请求。 我没有得到任何东西,如果我试图console.log消息,我没有看到任何exception,如果它是在事物的响应方面,我希望是这种情况。 我有其他的应用程序服务设置相同的方式,似乎工作正常。 我尝试从其中一个部署代码,并得到相同的行为。

我试图使用下面的代码进行最基本的testing

var http = require('http'); // Configure our HTTP server to respond with Hello World to all requests. var server = http.createServer(function (request, response) { console.log('Getting Response'); response.writeHead(200, {"Content-Type": "text/plain"}); response.end("Hello World\n"); }); var port = process.env.PORT || '3003'; server.listen(port); // Put a friendly message on the terminal console.log("Server running on port " + port); 

我得到响应Server running on port 8080 ,这导致我相信服务器启动正常。 但是,我只是在浏览器中获得友好的500.1001响应。 任何关于什么可能导致这种情况的想法,从我的angular度来看,与其他我们正在工作的其他网站一样。

Azure Web Apps仅支持HTTP 80的端口和HTTPS通信的端口443。 为避免此错误,您需要从应用程序设置中删除PORTvariables设置,因为Azure已经通过了variablesprocess.env.PORT中的一个端口,并且它不是一个真正的端口号,而是像\\.\pipe\(guid...) 。 请参阅Azure上的Node Js RestFull API,返回HTTP错误500.1001 – 内部服务器错误 。