I'm a beginner to deploying web apps on AWS and I believe I have a similar issue to AWS forward port 8000 from elb to port 8000 of EC2 where I have a reactjs frontend and golang api running on aws ec2 and the golang api is running on port 8000 which is accessible via my public_ip:8000 and gaves me messages saying my golang api is operational when I access public_ip:8000. I created the public_ip using Elastic IPs.
I used load balancers to get HTTPS as I have certain features that only work with HTTPS. However when I use my https://domain_name:8000 to send requests to my own API, it says it isn't there and gives me 404 errors when I used an Application Load Balancer.
My domain name uses AWS's Route 53 and AWS nameservers and should have no issues as I am being directed to my normal domain properly. I've added an A record pointing to my load balancer as well.
I've checked the security group used and I have opened up the ports to my IP address.
Below is how I've configured my Application Load Balancer's Target Group: and for my Listeners I've used HTTP 80, HTTPS 443 and HTTPS 8000 to forward to my target group.
I have tried using classic load balancers as mentioned in the link but they all timeout when I use my domain_name.
Anyone know either a better way to connect or a better way to structure my reactjs frontend and golang backend app on AWS that might need other ports open for api access.
My Classic Load balancer port forwarding config:
EDIT: I've noticed the problem might be my target group as it says that port 8000 is unhealthy and that the request timed out
It was taking forever to figure out the ports and none of the google searches or AWS documentation was helpful so I put my reactjs frontend in one EC2 Instance running on port 80 and my server/golang API into another EC2 instance running on port 80 and then set up the Application Load Balancer to forward to a target group with the frontend if HTTP:80 or HTTPS:443 is called and forward to the target group with the golang API if HTTPS:8000 is called.
Make sure that the instances are in the same availability zone as the load balancer or else it won't work properly and also ensure everything is healthy.