SSL Port NodeJS on Amazon Elatisc BeanStalk Single Instance

720 views Asked by At

Currently, there seems to be no method through BeanStalk's interface or API for allowing SSL connections on a single instance without ELB. How can this be done?

1

There are 1 answers

2
astone26 On

Update: Please note that AWS supports single instance SSL cert officially now: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/SSL.SingleInstance.html

Several people have voice an issue with this at Amazon's help forums, but the only method that seems to work is port forwarding.

Consider these steps:

First set your Node App to listen to a valid and open port for SSL connection. Then SSH into the instance that is running the app.

Enter: sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to {CurrentSSLPort}

So if you have an app running at port 8443 with HTTPS/SSL, this command would look like: sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to 8443

Note that if the environment is rebuilt, you'll need to forward the port again.