I have my nodejs hosted in ElastiCbean stalk environment. It uses the default configurations and default port. Now I am planning to open another port and listen to that port from Nodejs applicaiton. This is kind of opening nodejs in mutliple ports.
I have done the nodejs coding part.But i am not sure of the nginx changes to make it to listen to multiple ports. Can someone explain it to me?
I've only configured nginx for Java backends, but essentially you will need to configure the
server
directive to include the additional port you want to listen on, such as:So I recommend ssh on to your Nodejs EB server and fish around for your nginx config directories, looking for
nginx
,conf.d
folders, or annginx.conf
file. When you find it, you can override the defaultserver
config, or apply aninclude
statement to extend it, either way theserver
directive above should allow access on multiple ports as far as nginx is concerned.