Cant use a data folder on a mounted external HDD

Hello. I am trying to run nextcloud on a RPi4 with raspian.
I have installed nextcloud in /var/www/nextcloud and the web interface seems to be working. I have also added an external HDD to fstab as it follows:

UUID=xxx /home/pi/CLOUD-HDD ext4 defaults,auto,user,rw,nofail,noatime 0 0

As you can see I successfully mounted the HDD in /home/pi/CLOUD-HDD. Then, I used:

sudo chown -R www-data:www-data /home/pi/CLOUD-HDD
sudo chmod 750 /home/pi/CLOUD-HDD

The problem is that when in teh web interface I try to use the “CLOUD-HDD” folder, an error occurs regarding denied access. This only occurs on the mounted HDD, since I have no problem setting a random data folder like /home/pi/randomfolder. I guess the problem is “CLOUD-HDD” being a mounted drive and not a “real folder”. Can you help me with it?

@fotlvit It’s strange. I use a RAID 1 mounted in /nextcloud and it works. Maybe www-data user doesn’t have read access to your /home directory or /home/pi directory.