We have a multitenant app hosted on a forge server using tenancy package which allows tenants to specify a unique subdomain of our app domain or their own domain (pointing DNS at our server).
The main site contains all the goodness including environment, code, database, queues, schedules, deployment, wildcard cert, etc., and this all works fine with tenant subdomains.
When a tenant wants to bring their domain to us, the "hack" we are using is to create a new site (their domain) on the server using a "custom domain" nginx template which is identical to the default template except for a hardcoded root path pointing at our main site. (It may make sense to hardcode the logs to the main site as well ...). Forge spins up the default site directory with its empty public folder, but the site is otherwise "dumb", with no database, queues, etc. Add the let's encrypt SSL & this all works great, too.
Before we begin leveraging API's to automate the provisioning of the custom tenant domains, the question is whether this is a sustainable system. Each tenant using their own domain has (unbeknownst to them) their own site & nginx daemon on the server. We charge for this and need to decide whether the technical cost merits a high price (discouraging its use) or is just fine, even for hundreds of sites. (We should point out that the nice forge feature allowing the addition of alias domains in the main site's meta settings might offer an alternative solution, but did not give us the warm fuzzies when it comes to frequent updates to the main site nginx config and SSL certs.)
Experience or thoughts from anyone?