I believe {uri}
should give you the original request URI, and fastcgi always uses that one to pass upstream. (See https://github.com/mholt/caddy/issues/256) - the {rewrite_uri}
placeholder should give you the changed URI.
I’m literally working on a change to this right now to go out with the next release; the way we handle the request URI got a bit messy and I’m cleaning it up. I’ll be opening at least one or two pull requests in the next couple days for it! Would love to have your review.