Uri replace or insert prefix

What would be the syntax to “insert” a prefix to a path?

Was wanting to do something like this:

                        - find: *
                          replace: /path/im/inserting/{path}

(yaml config)

However, the * does not work.

Basically, for all requests to the proxy I want to hit the upstream with the same path but with /path/im/inserting inserted in the front of the path.

Don’t use uri_substring, use uri instead.

The value would be /prefix{uri}.

Using {uri} makes sure the query part is also preserved, otherwise only rewriting with {path} would drop the query.

1 Like