did some test using a subfolder for the installation of nextcloud, can confirm it works.
I just had to put generate a
.htaccess file at the root of the webfolder:
RewriteEngine on RewriteRule ^\.well-known/webfinger https://test.pontapreta.net/nextcloud/public.php?service=webfinger [QSA,L]
It is not the cleanest solution as it does some redirection and this should be hidden with some proxy stuff, but it works™