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:
server {
# listen for the extra the port the load balancer is forwarding to
listen 88;
access_log /var/log/nginx/access.log main;
client_header_timeout 60;
client_body_timeout 60;
keepalive_timeout 60;
gzip off;
gzip_comp_level 4;
location / {
# forward to the actual port the application runs on
proxy_pass http://127.0.0.1:8888;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
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
an nginx.conf
file. When you find it, you can override the default server
config, or apply an include
statement to extend it, either way the server
directive above should allow access on multiple ports as far as nginx is concerned.