I am testing with apache to see if php-fpm gives same redirect looping. Oddly, index.php is getting interpreted as text. I copied it to index2.php and that works though it claims it can’t write to the config directory, which has write permissions for apache.
Also, status.php returns a blank page.
<VirtualHost *:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot "/var/www/localhost/htdocs/nextcloud"
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
<Directory "/var/www/localhost/htdocs/nextcloud">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>