Home > Mobile >  ALB with path-based routing for ECS
ALB with path-based routing for ECS

Time:07-23

I have an ALB with path-based routing to an ECS task e.g. if Path is /abc/* forward to ecs-task1

However, now when I browse to www.example.com/abc it returns 404. But if I put index.html in /abc/ folder it works. It seems I need to either copy the files into /abc folder or I need to set the path directory of the webserver to prefix with /abc.

Is there an easy way to achieve path-based routing without having to modify the container so that the ecs task serve requests from the correct folder?

CodePudding user response:

It is not possible with ALB. That would require a path rewrite which is not supported in ALB.

You can try adding nginx in front and perform the path rewrite there.

  • Related