Change Document root to nextcloud directory

My nextcloud is installed in document root /var/www/nextcloud

I don’t want nextcloud to load its login screen at, but instead at

In other words I would like my own index.html to load at and not nextclouds index.php in the nextcloud directory.
I had this working on a previous install but not sure what to change. I’m using nginx and php8.1

Maybe you find this resources useful:

No nothing helped, I think the problem is in /etc/nginx/conf.d/nextcloud.conf
There is allot of rewrite stuff that I don’t understand in that config file. like this for instance:

    location / {
       rewrite ^ /index.php;

    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
       deny all;
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
       deny all;

    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {