0

I'm stuck trying to get my node app to run on my EC2 instance. I need to be able to use HTTPS to send and receive the data to my app and when I set the port to 443 in my environment and try to run my app I get

Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1336:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 443

If I set the port to 3000 however the app runs no problem but I can only transfer via HTTP and then my site gets a mixed content error when it tries to do a GET request. I've checked in my Security Group settings and the port should be open. Any help would be appreciated.

  • 2
    There are a zillion different ways to do this. See [http setup in amazon ES2](https://stackoverflow.com/questions/5309910/https-setup-in-amazon-ec2) for some ideas. Just Google it and you will find a ton to read. And, here's an Amazon article [I host a website on an EC2 instance. How do I allow my users to connect on HTTP (80) or HTTPS (443)?](https://aws.amazon.com/premiumsupport/knowledge-center/connect-http-https-ec2/). – jfriend00 Feb 07 '20 at 18:48
  • And, another article: [Setting Up An HTTPS Server With Node, Amazon EC2, NGINX And Let’s Encrypt](https://blog.cloudboost.io/setting-up-an-https-sever-with-node-amazon-ec2-nginx-and-lets-encrypt-46f869159469). There are hundres of articles like this to read. Which process to follow depends upon your other configuration choices. – jfriend00 Feb 07 '20 at 18:51
  • I tried the steps outlined on this page already and it's still not working. In the meantime, I've deployed to Heroku instead which is working but it would be nice to know how to resolve the issue on AWS if anybody knows how. – alberbecois Feb 07 '20 at 19:40
  • 2
    Are you running as root? – stdunbar Feb 07 '20 at 20:13

0 Answers0