2

We have multiple services running that serve different parts of our public API. These parts implement the same interface and share the same base path.

I am looking for a good way to implement an API Gateway, or reuse an existing software (e.g. reverse proxy) that can route incoming requests to the respective service, depending on an ID inside the request's path parameter.

/v1/things/{ID}

ID_1 -> route request to internalIP1/v1/things/{ID}
ID_2 -> route request to internalIP2/v1/things/{ID}

Whenever a new "thing" is created in our (fictional) registration-service and a new ID_x is generated, then the routing tables should be updated via an API. Afaik, API Gateways like tyk do not support this use case.

Nginx Plus offers a HTTP API where we could update the mapping dynamically for instance making a simple internal request. Nginx Plus costs money, however.

"Regular" Nginx also allows extensions written in lua which could access these advanced mappings from some kind of data storage, which should probably not http-based itself (speed and overhead), but maybe in-memory like a redis-based shared storage could another alternative.

This related question is four years old by now.

Community
  • 1
  • 1
John
  • 1,462
  • 10
  • 17

0 Answers0