title: nginx webdav could not open collection
body: <p>I have built nginx on a freebsd system with the following configuration parameters:</p>
  
  <p><code>./configure ... –with-http_dav_module</code></p>
  
  <p>Now this is my configuration file:</p>
  
  <pre><code>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 / {
        }
      }
  }
  </code></pre>
  
  <p>Now, the next things I do are check the syntax of the confiuration file by issuing a <code>nginx -t</code> and then do a graceful reload as follows: <code>nginx -s reload</code>.</p>
  
  <p>Now, when I point my web-browser to the nginx-ip-address:8080 i get the list of my files and folders and so on and so forth (I think that is due to the autoindex on feature).</p>
  
  <p>But the problem is that when I try to test the webdav using cadaver as follows:</p>
  
  <p><code>cadaver http://nginx-ip-address:8080/</code></p>
  
  <p>It asks me to enter authorization credentials and then after I enter that it gives me the following error:</p>
  
  <p><code>Could not open Collection: 405 Not Allowed</code></p>
  
  <p>And the following is the nginx-error-log line which occurs at the same time:</p>
  
  <p><code>*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"</code></p>
  
  <p>The username and pass work just fine wheni try to access it from the web-browser, then what is happening here?</p>