![Baikal 和 Carddav Android 20:不是目录](https://linux22.com/image/687695/Baikal%20%E5%92%8C%20Carddav%20Android%2020%EF%BC%9A%E4%B8%8D%E6%98%AF%E7%9B%AE%E5%BD%95.png)
我在新的 Debian 服务器上安装了 Baikal 0.4.5,并安装了 Nginx 和 PHP 5.6。之前安装 Baikal 时没有任何问题。遗憾的是,现在我无法在 Android 上连接 Carddav (https://example.com:443/baikal/html/dav.php/principals/用户名/default)。生成的错误是否假设缺少某个目录?
供您参考,网络界面运行良好。通过访问https://example.com/baikal/html/admin/我可以登录。在 /baikal/html/card.php 也是一样。
访问:
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1" 207 312 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php/ HTTP/1.1" 207 266 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /.well-known/carddav HTTP/1.1" 302 154 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php HTTP/1.1" 401 1806 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - username [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php HTTP/1.1" 207 615 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php/principals/username/ HTTP/1.1" 207 306 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1" 207 312 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
my_ip - - [06/Aug/2016:16:27:16 +0200] "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1" 207 312 "-" "CardDAV-Sync free/0.4.20.1 (Telephone; Tel_type; Android 5.1.1; Lang; org.dmfs.carddav.sync/141)"
错误:
2016/08/06 16:27:16 [alert] 28415#0: *22 dav_ext stat failed on '/var/www/example.com/web/baikal/html/dav.php/principals/username/default/' (20: Not a directory), client: 85.144.105.229, server: example.com, request: "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1", host: "example.com:443"
2016/08/06 16:27:16 [alert] 28415#0: *22 dav_ext stat failed on '/var/www/example.com/web/baikal/html/dav.php/' (20: Not a directory), client: 85.144.105.229, server: example.com, request: "PROPFIND /baikal/html/dav.php/ HTTP/1.1", host: "example.com:443"
2016/08/06 16:27:16 [alert] 28415#0: *23 dav_ext stat failed on '/var/www/example.com/web/baikal/html/dav.php/principals/username/' (20: Not a directory), client: 85.144.105.229, server: example.com, request: "PROPFIND /baikal/html/dav.php/principals/username/ HTTP/1.1", host: "example.com"
2016/08/06 16:27:16 [alert] 28415#0: *26 dav_ext stat failed on '/var/www/example.com/web/baikal/html/dav.php/principals/username/default/' (20: Not a directory), client: 85.144.105.229, server: example.com, request: "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1", host: "example.com:443"
2016/08/06 16:27:16 [alert] 28415#0: *26 dav_ext stat failed on '/var/www/example.com/web/baikal/html/dav.php/principals/username/default/' (20: Not a directory), client: 85.144.105.229, server: example.com, request: "PROPFIND /baikal/html/dav.php/principals/username/default/ HTTP/1.1", host: "example.com:443"
vhost 中 Baikal 的配置:
rewrite ^/.well-known/caldav /baikal/html/dav.php redirect;
rewrite ^/.well-known/carddav /baikal/html/dav.php redirect;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
提前致谢!
答案1
谢谢泰罗·基尔卡宁我能够解决这个问题。这只是文件配置中的问题。旧情况:
location ~ \.php$ {
try_files $uri =404;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
新的工作情况:
location ~ ^(.+?\.php)(/.*)?$ {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}