target group for multiple containers load balancer AWS
Solution 1:
You can't achieve that with AWS Load Balancer alone. AWS LB doesn't re-route traffic based on paths. They just forwards the incoming traffic to origin.
Your service should be accessible via 52.XX.XXX.XXX/user/swagger
52.XX.XXX.XXX/posts/swagger
etc. in order for Load Balancer to forward it. You can't forward (or re-route) your traffic from Load Balancer like this:
LB_URL/user/swagger -> IP/swagger
The missing /user/
part is not something Load Balancer can do for you. Update your application itself and add specific routes which you want to listen on.