@
@
@xave2017-05-27 18:43:29
Nginx
@xave, 2017-05-27 18:43:29

How to make friends with Windows WebDAV client, nginx and multi-user access?

There is a server running nginx, which is accessed via webdav. Everything was done according to this manual and worked great until I needed to make access for several users with their own logins and passwords. The most trivial option is to create another location with your own auth_basic_user_file. If you follow the example from the link, then something like this:

location ^~ /Family {
...
  auth_basic_user_file	/usr/local/etc/nginx/secure/family.htpasswd;
...
location ^~ /AnotherFolder {
...
  auth_basic_user_file	/usr/local/etc/nginx/secure/anotherfolder.htpasswd;
...
}

In the browser, such a thing works fine, i.e. while you are in the /Family folder, the server asks for a login + password from family.htpasswd, and as soon as you go to /AnotherFolder, it asks them from anotherfolder.htpasswd.
But the windows DAV client (tested on 8.1) in this case connects the /Family folder as a network drive and works fine with it. When trying to connect another disk for /AnotherFolder, it no longer asks for a login and password, but uses the old data, and somehow manages to get directory listings, despite the fact that nginx should generally require authorization in them using different credentials. At the same time, the files themselves on such a network drive are not opened. If, when connecting a second drive, you specifically select "use different credentials", then windows will give an error "The specified network folder is connected using a different username and password." I generally thought that such an error was possible only when working with network drives via SMB, but it turned out that it was not. Even more unclear ishttps://d.docs.live.net/UNIQUE_FOLDER_NAME/ and differ only in location, as in my case.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question