node.jsamazon-web-servicesapiamazon-ec2aws-application-load-balancer

How to configure AWS Application Load Balancer to point to multiple ports on the same server


I cannot get access to the second port that I want to have to. So, here are the listeners I have in my ALB: enter image description here

Additionally, my TG-dev is not healthy: enter image description here

I am not sure what is the reason for this. Basically, what is my setup - I have Node.js API that is running on the AWS EC2 instance, on port 8080, and I run it using the PM2. However, configured a development purposes only API that is currently running on port 8081, again using the PM2. I have access to port 8080, but unable to access the server at port 8081. Here is my Security Group (SG) that is allowing the access only from the LB: enter image description here

This points to the initial SG that has rules for both ports: enter image description here

How can I achieve my goal to have access to both, 8080 and 8081, ports?

EDIT: Here is also my pm2 list and what actually is happening on port 8080 and 8081. Maybe the reason why I cannot access 8081 is that there is difference, but I am not sure how this is configured, cause we do not have contact with the person who designed this. Any ideas are appreciated! enter image description here


Solution

  • Your processes are listening on IPv6 only but your security group doesn't have ports 8081 and 8080 open for IPv6, only for IPv4.