Docker nginx reverse proxy domain.tld/cloud setup

Im trying to setup nextcloud with docker to be reachable via domain.tld/cloud but i can’t get it to work. I can get to the setup page but when i click Finish Setup it directs me to domain.tld/index.php instead of domain.tld/cloud/index.php
How do i configure it correctly?

my docker-compose:

version: '3'
services:
    nginx:
        image: nginx
        restart: unless-stopped
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - ./data/nginx/conf:/etc/nginx/conf.d
            - ./data/nginx/www:/var/www
            - ./data/certbot/conf:/etc/letsencrypt
            - ./data/certbot/www:/var/www/certbot
        command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
    nextcloud:
        image: nextcloud
        restart: unless-stopped
        container_name: nextcloud
        hostname: nextcloud
        volumes:
            - ./data/nextcloud/nextcloud/:/var/www/html
            - ./data/nextcloud/apps/:/var/www/html/custom_apps
            - ./data/nextcloud/config/:/var/www/html/config
            - ./data/nextcloud/data/:/var/www/html/data
            - ./data/nextcloud/themes/:/var/www/html/themes
        environment:
            - TRUSTED_PROXIES=domain.tld
            - OVERWRITEHOST=domain.tld
            - OVERWRITEPROTOCOL=https
            - OVERWRITEWEBROOT=/cloud
            - POSTGRES_DB=nextcloud
            - POSTGRES_USER=nexcloud
            - POSTGRES_PASSWORD=password
            - POSTGRES_HOST=db
        depends_on:
            - nginx
            - db
            - certbot
    db:
        image: postgres:9.6
        volumes:
            - ./data/postgres:/var/lib/postgresql/data
        environment:
            - POSTGRES_PASSWORD=password
            - POSTGRES_USER=nextcloud
            - POSTGRES_DB=nexcloud
            - PGDATA=/var/lib/postgresql/data/pgdata
    certbot:
        image: certbot/certbot
        restart: unless-stopped
        volumes:
            - ./data/certbot/conf:/etc/letsencrypt
            - ./data/certbot/www:/var/www/certbot
        entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

nginx conf

server {
        listen 80;
        server_name domain.tld;

        location /.well-known/acme-challenge/ {
                root /var/www/certbot;
        }

        location / {
                return 301 https://$host$request_uri;
        }
}


server {
        listen 443 ssl;
        server_name domain.tld;
        ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

        location / {
                root /var/www/domain.tld;
        }

    location /cloud {
        proxy_read_timeout 900;
        proxy_connect_timeout 900;
        proxy_send_timeout 900;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://nextcloud/;
        client_max_body_size 1000M;
    }
}