i'm trying to configure Nginx to parse correctly two similar paths with a regex in it.
I have 2 services:
- /api/v1/myservice/{var}/client
- /api/v1/myservice/{var}/client/detail
{var} is a variable I'm reading which is working
Here my code (not using the var here):
location ~ /api/v1/myservice/(.*)/client {
return 200 "service 1 ";
}
location ~ /api/v1/myservice/(.*)/client/detail {
return 200 "service 2";
}
When I run curl like the following:
curl http://localhost/api/v1/myservice/623723852/client/detail
I see the response from the first location: "Service 1"
What Am I doing wrong? thanks