I'm creating a simple website on AWS Elastic Beanstalk using node js. I'm trying to add an SSL certificate to the EC2 instance but it keeps saying
"Error: listen EACCES: permission denied 0.0.0.0:443"
What did I miss?
EC2 Security Group:
Inbound Rules:
HTTP TCP 80 0.0.0.0/0
HTTP TCP 80 ::/0
HTTPS TCP 443 0.0.0.0/0
HTTPS TCP 443 ::/0
Outbound Rules:
All traffic All All 0.0.0.0/0
Node JS:
var ipaddress = "0.0.0.0";
var port = 443;
var options = {
key: sslKey,
cert: sslCert,
ca: [sslCa]
}
server = https.createServer(options, handleRequest);
server.listen(port, ipaddress, function () {
console.log("Server listening on port "+port);
});
I know this Elastic Beanstalk stuff is not documented well, but since I did the AWS DevOps certification some time ago which covered this, I remember some points:
0.0.0.0. I see you already did that.PORT environment variable to your node.js app and you should use it to listen for upstream traffic by the proxy. [1][1] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-platform-proxy.html
[2] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-nodejs.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With