Strip part of URI

In addition to the strip_path=true/false option we need to strip only a part (prefix) of the path.
I’d suggest an option like strip_path_prefix="/some-text".
The use case is having a single service with multiple routes attached which allow different consumers, for example:

  • /route - strip_path=true, allow consumer1
  • /route/health - strip_path_prefix="/route", allow consumer2

Such rewrites are basic Nginx functionality so it shouldn’t be hard to implement.
I have seen quite a few people asking for this feature, eg:
https://discuss.konghq.com/t/service-with-two-strip-path-routes/2596
https://discuss.konghq.com/t/strip-part-of-a-path-prefix-when-routing/1940
https://discuss.konghq.com/t/strip-some-part-of-uri/735

Appreciate any reaction,
thanks Pavel

10 Likes

This would be really useful for us as well

2 Likes

+1 Agreed would find this helpful also

2 Likes

yes please i am looking for same functionality

They already have a plugin request-transformer-advanced to handle such case. Although it only available with Enterprise subscription.

But anyway, really looking forward to have such strip_path_prefix to be available for all. Otherwise we have to create much more services and routes for the case…

It would be very useful for us.

Waiting for that feature as well.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ