Please check if you may have a clause like
# Disallow access to hidden files and directories
location ~ /\. {
return 404;
}
This isn’t recommended by nextclouds example config of nginx.
https://docs.nextcloud.com/server/14/admin_manual/installation/nginx.html?highlight=nginx
Source: https://github.com/nextcloud/server/issues/8802#issuecomment-427162499