Kong proxy with regex matching in URLs

I was referring to Proxy Reference - v2.3.x | Kong - Open-Source API Management and Microservice Management on how to use regexes for forwarding, but that isn’t clear enough.

I have 100s (soon 1000s) of services running in Kubernetes fronted by Kong and currently, each one has registered a proxy in Kong. They are of the form: Redirect "/api/version/<kubernetes_namespace>/<service_id>/<service_subid>/" to "https://api-<service_id>-<service_subid>-<kubernetes_namespace>" .

I wanted to get rid of the 100s of plugin configurations in Kong and only have a single one to do this matching and forwarding as we follow the same format.

Is this use case supported using regex as mentioned in the link above? If yes, how can I mention the matches in the proxy URI?



@hbagdi can you please help here or direct me to someone who might know about this? (or a doc would work too)