Nginx webdav could not open collection

I built nginx on a freebsd system with the following configuration options:

./configure ... –with-http_dav_module

Now this is my configuration file:

 user www www; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; # reserve 1MB under the name 'proxied' to track uploads upload_progress proxied 1m; sendfile on; #tcp_nopush on; client_max_body_size 500m; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; #upload_store /var/tmp/firmware; client_body_temp_path /var/tmp/firmware; server { server_name localhost; listen 8080; auth_basic "Restricted"; auth_basic_user_file /root/.htpasswdfile; create_full_put_path on; client_max_body_size 50m; dav_access user:rw group:r all:r; dav_methods PUT DELETE MKCOL COPY MOVE; autoindex on; root /root; location / { } } } 

Now the following things check the syntax of the confiuration file by issuing nginx -t , and then do a graceful reboot as follows: nginx -s reload .

Now, when I point my web browser to nginx-ip-address: 8080, I get a list of my files and folders, etc. etc. (I think this is due to the autoindex function).

But the problem is that when I try to check webdav using a corpse, as follows:

cadaver http://nginx-ip-address:8080/

He asks me to enter authorization credentials, and then after entering the password, he causes the following error:

Could not open Collection: 405 Not Allowed

And the following line is nginx-error-log, which occurs simultaneously:

*125 no user/password was provided for basic authentication, client: 172.16.255.1, server: localhost, request: "OPTIONS / HTTP/1.1", host: "172.16.255.129:8080"

The username and password are just wonderful when you try to access it from a web browser, and then what happens here?

+6
source share
1 answer

It turns out that the webdav module built into nginx is broken and to enable full webdav, we need to add the following external third-party module: nginx-dav-ext-module.

Link to his github: https://github.com/arut/nginx-dav-ext-module.git

Now the configure parameter will be:

./configure --with-http_dav_module --add-module=/path/to/the/above/module

The built-in method simply provides the PUT DELETE MKCOL COPY MOVE dav methods.

The nginx-dav-ext module adds the following additional dav methods: PROPFIND OPTIONS

You will also need to edit the configuration file to add the following line:

dav_ext_methods PROPFIND OPTIONS;

After that, check if the conf conf file syntax is: nginx -t

and then soft reboot (gracefully) nginx: nginx -s reload

And voila! now you can use a corpse or any other dav client program to enter directories.

I can’t believe that I decided this, it’s a little younger!

+11
source

Source: https://habr.com/ru/post/972003/


All Articles