The strip_path property
It may be desirable to specify a URI prefix to match an API, but not include it in the upstream request. To do so, use the strip_path
boolean property by configuring an API like this:
Enabling this flag instructs Janus that when proxying this API, it should not include the matching URI prefix in the upstream request's URI. For example, the following client's request to the API configured as above:
Will cause Janus to send the following request to your upstream service:
The strip_path
property can be used in tandem with Named URL Parameters
. i.e:
Akin to the previous example a request to janus like this:
Will cause Janus to send the following request to your upstream service:
This is because when the strip_path
property is set to true and a Named URL parameter
is used, the first instance of each section of the listen_path
(delineated by /
) will be removed from the upstream request. This includes the parameter name and regex.
In addition to that, the first instance of each Named URL parameter
will be removed from the upstream request.
Last updated
Was this helpful?