Prefix Rewrite

PrefixRewrite allows you to replace (rewrite) the matched request path with the specified value. To remove a prefix, you may need to configure 1-2 routes to get your desired result with a prefixRewrite: "/" setting. That is, if you wanted to match a route prefix of /foo and then remove /foo before sending to upstream, you would need to define two (2) routes to achieve this. First create a route matcher for prefix: /foo/ with a prefixRewrite: /, and the create a second route matcher for prefix: /foo with a prefixRewrite: /. Order matters for route matching. The /foo/ => / rewrite “fixes” the :path // problem that occurs with a single route matcher of /foo. See Envoy prefix rewrite doc for more details.

Setting prefixRewrite to "" is ignored. Its currently interpreted the same as if you did not provide any value at all, i.e., do NOT rewrite the path.