You just need to add to config.php
'htaccess.RewriteBase' => '/',
and execute afterwards:
occ maintenance:update:htaccess
How to use the occ- command: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
How to run the occ command in a web terminal: https://apps.nextcloud.com/apps/occweb