I created the first handle_path and it worked, API A received the requests made to /apia/v1, as expected.
However, I have two APIs, A and B, and I need to route the messages that arrive at /apia* to the service running on port 3001 and the requests that arrive at /apib* to the service running on port 3002.
But when I added the second service, all requests are going to it. Below is what I tried but it didn’t work.
Please fill out the help topic template as per the forum rules.
It seems like you don’t need handle_path in your case, you should simply use handle and remove the rewrite. You only need handle_path if you do want to strip the path prefix from the request before handling, but you’re re-adding the prefix immediately with a rewrite which is redundant.
Make sure the config you show us is actually what you’re trying. Don’t edit your config before sharing it, because your edits may change the actual problem.