Trialing deploying a React front end / FastAPI backend to AWS Fargate. Would like both containers to be available with the same IP every time they start, so using an elastic IP.
API container listening on 8000 running as a service. React container listening on 80 running as a service.
I have a network load balancer listening on 80 and 8000. Both listeners are forwarding to the same target group (test-targetgroup) which has the API container registered on 8000 and the React container registered on 80.
I would expect to see:
elastic-ip:80 -> NLB -> TCP:80 listener -> test-targetgroup -> react-container-ip:80
elastic-ip:8000 -> NLB -> TCP:8000 listener -> test-targetgroup -> api-container-ip:8000
I am seeing the requests occasionally routed to the wrong container e.g. elastic-ip:8000 returning the HTML response as though the request was for elastic-ip:80
Any advice on how this has been misconfigured would be helpful.