Search code examples
amazon-web-servicesapacheamazon-ec2amazon-ecsaws-application-load-balancer

path based routing for ecs service is not working


path-based-routing

I have an alb pointing to my ecs service registered to target-group-one. The DNS of the load balancer works fine and able to print the message from my simple apache webserver. However when I configure path based routing like in the image attached and the add the path to the the DNS url ......com/gci, I get the error message The requested URL was not found on this server.

What am I missing or not doing right?


Solution

  • If your actual httpd server does not respond to /gci without ALB, then it will not work with ALB. The path rule that you configured only forwards the query to your target group (TG).

    So if the rule matches www.example.com/gci, ALB will just forward the query to the associated TG. This means that your ECS service still must correctly respond to /gci path.

    In other words, the forwarding rules of ALB do not re-write the paths.