|
| Question: | 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.
$ 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:
- - [13/Apr/2012:23:57:18 +0400] "OPTIONS /files/webdav.php/ HTTP/1.1" 405 141 "-" "davfs2/1.4.6 neon/0.29.3
$ 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:
$ 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
use_locks 0
and run:
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.
$ 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 virtualhost config:
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;
}
}
| | |
| Add answer Back to overview
Add comment
|