Closed csandmann closed 8 years ago
Hello, I am also unable to get Baikal to run with NGINX. I have tried both, the flat package in a subdirectory, and the regular package on a subdomain. With both, I get the calendar to work with almost no effort, but the addressbooks insist on giving me a 404 during PROPFIND. I am using the current mainline version of NGINX, which I compile myself on my RPi running Raspbian. The connection to my server is SSL-secured, but I've tried with an unsecured http connection as well, and the error persists. What's driving me mad is that with Apache it worked just out of the box - I have tried that some time ago with a Ubuntu Server 12.04 in VirtualBox. So I suspect, that it is a configuration issue with NGINX, but after having tried numerous solutions an how-tos I found on the web, I am stuck. Here's my 'nginx -V':
nginx version: nginx/1.9.1
built by gcc 4.6.3 (Debian 4.6.3-14+rpi1)
built with OpenSSL 1.0.1e 11 Feb 2013
TLS SNI support enabled
configure arguments:
--with-cc-opt='-I /home/pi/build/staticlibssl/include -I/usr/include'
--with-ld-opt='-L /home/pi/build/staticlibssl/lib -Wl,-rpath -lssl -lcrypto -ldl -lz'
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--pid-path=/var/run/nginx.pid
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--with-pcre=/home/pi/build/pcre-8.36
--with-http_ssl_module
--with-http_spdy_module
--with-http_dav_module
--add-module=/home/pi/build/nginx-dav-ext-module-master
--with-file-aio
--with-ipv6
--with-http_gzip_static_module
--with-http_stub_status_module
--with-http_geoip_module
--with-http_realip_module
--with-http_sub_module
--with-debug
--without-mail_pop3_module
--without-mail_smtp_module
--without-mail_imap_module
Here's my nginx baikal config file:
server {
listen 443 ssl;
server_name sub.domain.tld;
# New StartSSL verified key
ssl_certificate /etc/ssl/certs/unified.crt;
ssl_certificate_key /etc/ssl/certs/my-private-decrypted.key;
root /var/www/baikal/html;
index index.php;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass php;
fastcgi_index index.php;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
server {
listen 80;
server_name sub.domain.tld;
return 301 https://sub.domain.tld$request_uri;
}
Here's the nginx access.log output:
100.200.100.200 - fberke [12/Jun/2015:12:15:05 +0200] "PROPFIND /card.php/addressbooks/fberke/privat/ HTTP/1.1" 404 313 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 Lightning/3.3.2"
And here's nginx' error.log on debug level: https://gist.github.com/fberke/f09cbac87c69bca7ab37
Hello, I'd like to chime in here. I'm in the very same situation, not being able to get baikal to work in a subdir with nginx. Is there a working, simple nginx configuration anyone can provide? I have no sufficient knowledge of nginx to reach a solution, unfortunately. Thanks
@check0104 :
If I change the caldav-base uri in the system settings to PROJECT_BASEURI . "groupdav/cal.php/", I get the following error messag, whenever I try to load https://ip/baikal/cal.php in my webbrowser
Don't do this =) If you change the base uri, you also need to actually access the server using that uri. I would suggest just keeping the default.
@fberke
You absolutely MUST turn off this:
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
Where did you even get that? If it's in our documentation somewhere we need to get rid of it. Turning on those settings with cause nginx to handle WebDAV methods and that's not what you want. Baikal itself is responsible for handling those methods and this setting will just cause nginx to intercept it and send responses for it instead.
@spidernik84 if you're still experiencing issues, please open a new ticket with a lot more information (baikal version, nginx config, which client you are using).
Since this ticket is a bit old I'm closing it, but if there are further issues/comments just comment here and I will reopen.
I had to compile nginx from source with --add-module=../nginx-dav-ext-module-master
for PROPFIND to work as expected. Also php7.0 needs php7.0-mbstring
to work on a fresh Ubuntu 16.10
install.
@atrioom nginx's DAV module is absolutely not needed and should be disabled.
Hmm, I just tried it with disabled DAV modules and you are right. It works without the modules. I swear that my android CardDav Sync App did not connect (PROPFIND -> 405) and only did connect once I recompiled with the ext-dav addon...
Hi there,
I am trying to set up my own calendar/contact server. After longer research and recommendations from friends I decided to use the Baikal regular package. Since I don't have a domain, I want to run baikal on a subpage, not a subdomain.
The problem I am encountering seems to lie in the combination of nginx / subpage: I can access the admin-area without problems, but for some reason I keep getting "Error 404" whenever I try to load the calendar into thunderbird.
I realize that this issue already came up on github, but for some reason the proposed solution did not work for me.
I am trying to run Baikal on the following configuration
The specific problems seem to be
PROJECT_BASEURI . "groupdav/cal.php/"
, I get the following error messag, whenever I try to loadhttps://ip/baikal/cal.php
in my webbrowserPROJECT_BASEURI . "baikal/cal.php/"
I get a login-screen (yay!). After entering username and password I get the following error:https://ip/baikal/cal.php/calendars/MYUNAME/default
This yields in an Error 404 with the following entry in the nginx logfile:"^(/baikal)(/.?.php)(/.)?$" does not match "/baikal/cal.php/calendars/MYUNAME/default"
Does anyone see, where the problem might lie?
Best
Constantin