I want to rewrite an url where a subpath becomes a parameter using nginx as a reverse proxy. So /path1/path2/bar should become /path1/path2?foo=bar. Is
/path1/path2/bar
/path1/path2?foo=bar