How to fix "Port 80 requires elevated privileges" in Windows Azure with node.js?

I created a simple Node.js express tutorial and it runs locally. I configure my Azure Web App to pull the repo from BitBucket, which it does, but I get the following error in LogFiles / Application:

Port 80 requires elevated privileges

Why is this happening? Does node work at elevated privileges? If not, how do I configure it like this?

UPDATE: IMPORTANT !!!

This is never explained clearly in any documentation I saw ...

Azure seems to be doing port forwarding for Node.js applications. Therefore, when you click the Azure URL on port 80/443, it is redirected to another port on which the Node.js application is running. YOU DO NOT INSTALL THIS PORT !! This is an Azure-driven environment variable, so you are just listening to the process.env.PORT process. Done what it is.

+4
source share
4 answers

I assume you are using the Azure App Service. Even from the point of view of the end user, the request is through port 80, you will need to update the application to listen on the port that it receives from the environment variable, the port on which the balancing balancer will actually distribute the request.

See below for more details.

https://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-develop-deploy-mac/

var http = require('http')
var port = process.env.PORT || 1337;
http.createServer(function(req, res) {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello World\n');
}).listen(port);
+2

. PORT = 80 env (Application Settings). PORT Azure , .

+2

Nginx,

Nginx ( " x" ) - -. - HTTP, HTTPS, SMTP, POP3 IMAP, HTTP-.

root 80.

+1

sudo. . fooobar.com/questions/31939/...

nodejs 80. node root.

0
source

All Articles