I don’t think you need to do all this development. There should be no need to create own files. Basically, it is quite simple.
- adjust
/etc/nginx/sites-available/default
and changeroot /var/www
intoroot /var/www/nextcloud
- adjust
/etc/nginx/sites-available/default
and remove small block forlocation /
- adjust
/etc/nginx/sites-dietpi/dietpi-dav_redirect.conf
and remove sub path/nextcloud
from all configs - adjust
/etc/nginx/sites-dietpi/dietpi-nextcloud.conf
and remove sub path/nextcloud
from all configs (should be quite some) - restart Nginx