5

I have a number of containers running in Amazon ECS (in a private subnet) and each serving a different app on port 8080.

I have a public-facing ELB (attached to apps.example.com) forwarding traffic based on the requested path. To illustate, apps.example.com/app1 is forwarded to the target group for the app1 service on port 8080.

The problem I have is that the apps running in the containers are not expecting a path.

Right now, it seems like apps.example.com/app1 is forwarded to private_app1_container:8080/app1 but I need it to be forwarded to private_app1_container:8080.

Is there a way to achieve that?

I am creating the forwarding rules via the aws web interface and while I can forward to a specific target group, I do not see a way to specify the forwarding path. I have thought of redirecting instead of forwarding but my containers are in a private subnet and I would like them to stay isolated.

asachet
  • 6,620
  • 2
  • 30
  • 74
  • BTW I am quite flexible on my current architecture since it is just a prototype. If this is not a good way to serve multiple independent private apps, do shout. – asachet Feb 05 '19 at 10:43
  • Perhaps you can instead set up your forwarding rules based on host. So for example `app1.apps.example.com` would forward to the the `app1` target group. Also you mention that your apps are running on port 8080; I would use dynamic port mapping instead along with an application load balancer - it is more scalable and might make your desired configuration more achievable. – Richard Francis Feb 06 '19 at 13:41
  • Does this answer your question? [AWS ELB rewrite path and alter the path in between](https://stackoverflow.com/questions/53157427/aws-elb-rewrite-path-and-alter-the-path-in-between) – qfwfq Sep 02 '22 at 22:17

0 Answers0