URL Versioning(first element) appended to upstream target


#1

Hello there,

I am facing a problem.
I want to handle versioning in as the first url element, but the version is then append to the upstream target url and that cause some major problem as you can imagine.

Say i want to get a resource “customers”

What i would like
ex: tyk-host-api/v1/customers => upstream-target-url/customers

What i get:
ex: tyk-host-api/v1/customers => upstream-target-url/v1/customers

How am i suppose to handle this scenario ?


#2

You may want to add a URL rewrite, the version data is not stripped from the path.


#3

Is it possible to do it globally for an api ?

Cause if i have to do it per resource(path) that would be annoying.

Thanks in advance.


#4

Afraid not - these settings are per-path :-/


#5

+1 for a boolean option to strip the versioning information from the path


#6

+1 for an option to execute an inline “REPLACE” in the called URL.

This can fit nicely close to the GLOBAL VERSION SETTINGS here:

The version URL might also benefit from some flexibility:

Maybe some kind of ACL approach? HAProxy has some good practises.


#7

Starting small, we’ve put this in our backloog:

Feel free to suggest features in our GH tracker :slight_smile:


#8

Cool!, Thanks!

Adding some more text because I can’t seem to post this short messages; probably this is set for a good reason but hey, I’m ingorant. :kissing_heart: