Search code examples
javareactjsamazon-web-servicesnginxamazon-ecs

AWS-ECS Deploy got 404 NOT FOUND


I'm facing with a problem when deploy microservice to ecs-cluster my cluster

  • 6 java (ecs services)
  • 2 python services
  • 1 react

And I used ALB for routing my request(by path url)

ex: if url is /javaservice1 -> forward to service1 target group(with ecs service running)

...

And if url is not match anything -> routed to react app(deployed by nginx)

Everything is good, but when I go to login page, It's good, But if I press F5, it got 404 Notfound.

What is the problem? Ecs-cluster?


Solution

  • Update your nginx config. It's the nginx problem, not ecs-cluster.Try this

    try_files $uri $uri/ /test/index.html;