I agree that the latter would be nicer.
I think it can be tracked down to the proc rp_path_prefixes (only used in rp_filter) which returns
/foo/bar/ /foo/ /when given the path /foo/bar/. Changing it to return
/foo/bar/ /foo/bar /foo/ /foo /seems to do the trick. This needs some further testing though if path_info is always correct etc.