problem owncloud webdav on nginx and davfs2

Ask all your questions regarding OC 4.x and older. Please read the Support Forum Rules
Forum rules
Version 4 is not supported anymore! Please upgrade your ownCloud for security and support.
Before you post; make sure you are using at least PHP Version 5.3.x - Also read Support Forum - Read this before posting

problem owncloud webdav on nginx and davfs2

Postby denis21 » Fri Apr 13, 2012 10:58 pm

I tried to used davfs2 on debian 6.0.4 for works owncloud webdav, but received a message from nginx is not allowed to use the OPTIONS.

Code: Select all
$ sudo mount -t davfs https://cloud-storage.mydomain.com/files/webdav.php /mnt/cloud-storage.mydomain.com
Please enter the username to authenticate with server
https://cloud-storage.mydomain.com/files/webdav.php or hit enter for none.
  Username: denis
Please enter the password to authenticate user denis with server
https://cloud-storage.mydomain.com/files/webdav.php or hit enter for none.
  Password: 
/sbin/mount.davfs: Mounting failed.
405 Not Allowed

In nginx access.log:
Code: Select all
 - - [13/Apr/2012:23:57:18 +0400] "OPTIONS /files/webdav.php/ HTTP/1.1" 405 141 "-" "davfs2/1.4.6 neon/0.29.3"


Code: Select all
$ nginx -v
nginx version: nginx/1.0.15


i'm recompiled nginx and adding module https://github.com/arut/nginx-dav-ext-module
and add in vhost config: dav_ext_methods PROPFIND OPTIONS;
but new error:

Code: Select all
$ sudo mount -t davfs https://cloud-storage.mydomain.com/files/webdav.php /mnt/cloud-storage.mydomain.com
Please enter the username to authenticate with server
https://cloud-storage.mydomain.com/files/webdav.php or hit enter for none.
  Username: denis
Please enter the password to authenticate user denis with server
https://cloud-storage.mydomain.com/files/webdav.php or hit enter for none.
  Password: 
/sbin/mount.davfs: warning: the server does not support locks
$ ls /mnt/cloud-storage.mydomain.com
404  lost+found

In nginx access.log:
[14/Apr/2012:01:50:44 +0400] "PROPFIND /files/webdav.php/ HTTP/1.1" 207 249 "-" "davfs2/1.4.6 neon/0.29.3"

if edit /etc/davfs2/davfs2.conf
Code: Select all
use_locks       0

and run:
Code: Select all
sudo umount /mnt/cloud-storage.mydomain.com
sudo mount -t davfs https://cloud-storage.mydomain.com/files/webdav.php /mnt/cloud-storage.mydomain.com

All installed fine. But in the contents of the directory is not what it really is.

Code: Select all
$ ls -la /mnt/cloud-storage.mydomain.com
итого 1
drwxr-xr-x 3 root root 104 Апр 14 02:05 .
-rw-r--r-- 1 root root   0 Апр 14 02:05 404
drwx------ 2 root root   0 Апр 14 01:47 lost+found
$ file /mnt/cloud-storage.mydomain.com/404
/mnt/cloud-storage.mydomain.com/404: empty


nginx virualhost config:
Code: Select all
server {
   listen 443 ssl;
   ssl_certificate /etc/nginx/cert/cloud-storage.mydomain.com.crt;
   ssl_certificate_key /etc/nginx/cert/cloud-storage.mydomain.com.key;
   server_name cloud-storage.mydomain.com;   
   ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
   ssl_ciphers                 AES256-SHA:AES128-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
   ssl_prefer_server_ciphers   on;
   ssl_session_cache shared:SSL:10m;
   ssl_session_timeout 10m;
   access_log    /var/log/nginx/cloud-storage.mydomain.com/access.log;
   error_log       /var/log/nginx/cloud-storage.mydomain.com/error.log;
   root /var/www/cloud-storage.mydomain.com;
   index index.php;
   dav_methods PUT DELETE MKCOL COPY MOVE;
   dav_ext_methods PROPFIND OPTIONS;
   create_full_put_path on;
   dav_access user:rw group:rw all:r;
   client_max_body_size 1000M; # set maximum upload size
   add_header Strict-Transport-Security max-age=31536000;
   add_header X-Frame-Options SAMEORIGIN;
   add_header X-Content-Security-Policy "allow 'self';";
   add_header X-XSS-Protection "1; mode=block";
   add_header Content-Length $content_length;
   set $server_headers $server_name;
   more_set_headers 'Server: $server_headers-webservers';
   keepalive_timeout   70;
   
   location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
      deny all;
   }
   
   location / {
      try_files $uri $uri/ @webdav;
   }

   location @webdav {   
      try_files $uri $uri/ 404;
      fastcgi_split_path_info ^(.+\.php)(/.*)$;
      fastcgi_pass unix:/var/run/fpm/cloud-storage.mydomain.com.sock;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param HTTPS on;
      include fastcgi_params;
   }

   location ~ \.php$ {
      try_files $uri $uri/ 404;
      fastcgi_pass unix:/var/run/fpm/cloud-storage.mydomain.com.sock;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param HTTPS on;
      include fastcgi_params;
   }
   location ~ /.svn/ {
      deny all;
   }
   location ~ /.git/ {
      deny all;
   }
   location ~ /.cvs/ {
      deny all;
   }
   location = /favicon.ico {
      log_not_found off;
      access_log off;
   }
   location = /robots.txt {
      log_not_found off;
      access_log off;
   }
}


what is problem?
Last edited by denis21 on Sat Apr 14, 2012 12:13 am, edited 1 time in total.
denis21
Beginner
 
Posts: 23
Joined: Fri Mar 23, 2012 4:42 pm
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.3.22

Re: problem owncloud webdav on nginx and davfs2

Postby trogdan » Mon Oct 15, 2012 4:18 am

same problem here, fighting with 405 and nginx
trogdan
Newbie
 
Posts: 5
Joined: Sun Oct 07, 2012 5:47 pm

Re: problem owncloud webdav on nginx and davfs2

Postby Rancor » Mon Oct 15, 2012 7:36 am

Hi,

if you have added the dav_methods and dav_ext_methods like denis21 remove them from your config and use the nginx config provided here:

http://owncloud.org/support/webserver-notes/
*inactive*
Rancor
OwnCloud master
 
Posts: 8456
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 7.0.1
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.5.x


Return to ownCloud Community Edition 4.x and older

Who is online

Users browsing this forum: No registered users and 5 guests