Permission denied can't read directory

I’m right now installing nextcloud-18-0-1. I use it on a Apache Server with SSL on Rasbian 10 Buster.
I try to use a data directory on an external harddrive.
The harddrive is mounted by fstab on startup to “/media/usb” and i can create and write files with my user.

Im tunneling the http port of the raspberry to an external Server with static IP where it is proxy-forwarded and tls encrypted by an nginx server.

So far so good.

I created also a nextcloud folder on the harddrive which i want to use for storing the nextcloud data.
It has the same owner and group like the /var/www/nextcloud where i installed the nextcloud.
The user is “www-data”.

The problem is I can not upload any files. Not in the WebInterface and not through WebDav.
The Apache Log is full of that:

[Sat Feb 15 02:44:13.919953 2020] [negotiation:error] [pid 15055] (13)Permission denied: [client ::1:34714] AH00686: cannot read directory for multi: /var/www/nextcloud/

I guess “multi” means not a user here, or does it? And where does it come from?

The Admin Log tells me always that:

The Nginx Proxy Server Error.log shows the following:

2020/02/15 04:39:39 [error] 1149#1149: *1 connect() failed (111: Connection refused) while connecting to upstream, client: *client-dynamic-ip*, server: *domain-of-the-proxy-server*, request: "PROPFIND /remote.php/dav/files/garbage_collector/ HTTP/1.1", upstream: "", host: "*domain-of-the-proxy-server*"

is your directory /media/usb writeble by www-data.

should have permissions like drwxr-x--- www-data www-data or drwxrwx--- root www-data

see if the following helps
where “share” represents your NC data directory.

cd /media
sudo chown root:www-data usb
sudo chmod 775 usb
cd usb
sudo chown www-data:www-data share
sudo chmod 750 share

basicly www-data needs write permission inside /media/usb inside usb is your data directory share owner and group www-data with 750 permission.
everything inside your data directory should be owned by www-data.
If you already have files and directories stored with wrong permissions you can fix by the following


cd /media/usb/share

find all files inside /media/usb/share and change permisson to -rw-r-----

find ./ -type f -print0 | xargs -0 sudo chmod 640

find all directories inside /media/usb/share and change permission to drwxr-x—

find ./ -type d -print0 | xargs -0 sudo chmod 750

Recursivly change owner and group inside /media/usb/share to www-data

sudo chown -R www-data:www-data ./

hope this helps in any way