Permission error via dynamicdns but not local

I’ve set up the latest version of nextcloud on the latest version of Raspberry Pi OS. I followed the pimylifeup tutorial and then I moved the data directory to an external HDD that I manually mounted to /mnt/usb1.

The problem I have now is that when i access nextcloud via dynamicdnsaddress/nextcloud i get the following error:

Error

Your data directory is readable by other users

Please change the permissions to 0770 so that the directory cannot be listed by other users.

However if i access nextcloud via localip/nextcloud I don’t get the error.

Is my problem related to the dynamicDNS somewhere?

Or is it actually something to do with my permissions?

Nextcloud was originally installed to /var/www/html with www-data being the owner of /var/www/html/nextcloud and view, change and access content only being available to owner and group.
However I then moved the data folder to mnt/usb1/nextcloud where root is owner and ‘anyone’ has view change and access permissions.

I suspect this last thing is the issue however

sudo chown -R www-data:www-data /mnt/usb1/nextcloud/data

doesn’t do anything, also doesnt give an error when i execute it.

I mounted the external medium in fstab with this line:

UUID=the uuid /mnt/usb1 ntfs defaults,auto,users,rw,nofail,noatime 0 0

does this overwrite permissions i try to manually set?

I assume me not being able to track down the problem here has everything to do with my very limited knowledge of unix commands and the system in general. However I would very much appreciate any help or feedback anyone is able to give me.

Thx in advance

What does your 'trusted_domains' array look like, in /var/www/nextcloud/config/config.php?

I do something similar to you, and I have both my local host names and my dynamic DNS host name in that array.