Great! You can replicate the issue! Now, let’s work on fixing it. Whew.
Let’s start by answering the question: “Why are any requests from the Nextcloud clients going to /var/www instead of /var/www/nextcloud?”
That should be where we focus. If this is outside the scope of your OS, then so be it, but I started here first because it seemed logical to do so. I am glad you are able to replicate the issue.