Score:0

Every port in centos 7 requires elevated privileges

cn flag

I'm trying to combine an express js app with nginx. The express app runs on port 3001 or 8000 and then with nginx I'd like to listen to port 443 and forward the requests to that app:

/etc/nginx/sites-available/example.com has this content:

server {
    listen 443 ssl;
    server_name example.com;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log debug;
    ssl_certificate x.crt;
    ssl_certificate_key path/ca.key;

    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         "http://127.0.0.1:3001";
    }

}

but then when I start my expressjs app with forever I get these errors:

Port 3001 requires elevated privileges
error: Forever detected script exited with code: 1
error: Script restart attempt #9
Port 3001 requires elevated privileges
error: Forever detected script exited with code: 1
error: Script restart attempt #10
Port 3001 requires elevated privileges
error: Forever detected script exited with code: 1
error: Script restart attempt #11

Whatever port I try it says it requires elevated privileges. I just want my app to run on https without requiring root privileges. If I start it with sudo and without nginx it works, but I'm trying to avoid that.

Thanks

djdomi avatar
za flag
the block for nginx looks legitimate,but i think your application is the issue
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.