Rewrite first then evaluate php_fastcgi

You could try env REQUEST_URI {uri}

Consider reporting this issue to Nextcloud for them to fix it.