Properly adding overwritewebroot

I have a website that runs behind a reverse proxy using NGiNX 1.18 and Let’s Encrypt SSL cert. NGiNX converts http to https and adds the www. So it is and Nextcloud resides in /var/www/cloud. I am confused as to how I am to write the overwritewebroot properly since this is in a subdomain and not

Can anyone please help?

The best/safest way is to use occ config:system:set. See the documentation here:

You can also manually add it to your config.php.