Hi,
I've moved my DAViCal server to a new system (RPi4 w/ Raspbian). DAViCal now runs as a virtual https host under Nginx (the old system used Apache2).
Now InfCloud stopped working. It just displays red exclamation marks.
Oddly enough, none of the other DAViCal clients (vdirsyncer, android clients) experienced any problems, they all continued functioning without even blinking.
Are there any special settings necessary for DAViCal / InfCloud when using Nginx?
-- Johan
Hi Johan,
there is nothing special ... InfCloud = static files on the disk returned by a web server to your browser (where these are executed by JavaScript engine). And JavaScript has a lot of security constraints (e.g. CORS) that can be "fixed" only by returning proper HTTP headers from your Cal/CardDAV server.
My tip is: Nginx does not processes the .htaccess file and/or there are missing CORS headers (previously present in your Apache config) ... check the console log.
JM
On 19 Feb 2020, at 23:52, Johan Vromans jvromans@squirrel.nl wrote:
Hi,
I've moved my DAViCal server to a new system (RPi4 w/ Raspbian). DAViCal now runs as a virtual https host under Nginx (the old system used Apache2).
Now InfCloud stopped working. It just displays red exclamation marks.
Oddly enough, none of the other DAViCal clients (vdirsyncer, android clients) experienced any problems, they all continued functioning without even blinking.
Are there any special settings necessary for DAViCal / InfCloud when using Nginx?
-- Johan
Hi Ján,
On Thu, 20 Feb 2020 08:49:18 +0100, Ján Máté jan.mate@inf-it.com wrote:
My tip is: Nginx does not processes the .htaccess file
The .htaccess files are for apache only.
and/or there are missing CORS headers (previously present in your Apache config) ... check the console log.
Yes, CORS... as always. Setting up CORS in nginx is non-trivial. Sigh.
On Thu, 20 Feb 2020 14:01:58 +0100, Johan Vromans jvromans@squirrel.nl wrote:
Yes, CORS... as always. Setting up CORS in nginx is non-trivial. Sigh.
With some help from the interwebs and a lot of trial and error I got InfCloud going again in the new setup. But with a twist...
As I can trace it, it seems that InfCloud requires a 204 response on OPTION queries. The other clients (CalDAV-Sync, DAVx5, vdirsyncer) want the 'normal' 200 response code. I can configure nginx to force return 204 but that will cause the other clients to stop updating.
So I'm stuck here. Either InfCloud works, or all the other clients.
Am I really the only one running (trying to run) a DAViCal with Nginx?
Hi Johan,
your configuration must be broken - correctly configured OPTIONS response cannot break other clients. And also InfCloud does NOT send the OPTIONS request - it is sent by YOUR BROWSER (it is the "preflight" request defined by CORS).
See the CORS specification, e.g.:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
JM
On 27 Feb 2020, at 08:30, Johan Vromans jvromans@squirrel.nl wrote:
On Thu, 20 Feb 2020 14:01:58 +0100, Johan Vromans jvromans@squirrel.nl wrote:
Yes, CORS... as always. Setting up CORS in nginx is non-trivial. Sigh.
With some help from the interwebs and a lot of trial and error I got InfCloud going again in the new setup. But with a twist...
As I can trace it, it seems that InfCloud requires a 204 response on OPTION queries. The other clients (CalDAV-Sync, DAVx5, vdirsyncer) want the 'normal' 200 response code. I can configure nginx to force return 204 but that will cause the other clients to stop updating.
So I'm stuck here. Either InfCloud works, or all the other clients.
Am I really the only one running (trying to run) a DAViCal with Nginx?
Hi Johan,
unfortunately I never configured Nginx for CORS.
CORS headers should be implemented directly by the server (that's the normal case). Adding them in the web server configuration is just a workaround ...
JM
On 27 Feb 2020, at 16:46, Johan Vromans jvromans@squirrel.nl wrote:
Hi Ján,
On Thu, 27 Feb 2020 10:58:41 +0100, Ján Máté wrote:
your configuration must be broken
That's one thing that I'm sure of... But I have no idea what I can do to fix it.
Would it be helpful if I provide access to my DAViCal server?
-- Johan
I use infcloud with davical with nginx without problem... Here is my config in case...
server { server_name davical.bidon.eu davical.secours.bidon.eu; ssl_certificate /etc/acme/fullchain/davical.bidon.eu.pem; ssl_certificate_key /etc/acme/key/davical.bidon.eu.pem; root /usr/share/davical/htdocs; index index.html index.htm index.php index.pl; # begin : https section listen 443 ssl http2 ; listen [::]:443 ssl http2; # les parametres généraux de ssl sont inclus dans : // only ssl params here include /etc/nginx/pc_https.conf ;
# end : https section keepalive_timeout 0; client_max_body_size 8M; # has to be same size as in php.ini, else worthless!
location /images/ { }
location / { auth_basic "toldev"; auth_basic_user_file /etc/nginx/toldev.password; try_files $uri $uri/ =404; }
location ~ ^(.+.php)(.*)$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_pass_php_socket; fastcgi_split_path_info ^(.+.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; }
location ~ .php$ { try_files $uri =404; include fastcgi_params; include /etc/nginx/fastcgi_pass_php_socket; fastcgi_index index.php; fastcgi_split_path_info ^(.+.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; }
location =caldavzap/ {
try_files /infcloud/index.html =404; auth_basic off; add_header Cache-Control "max-age=0, must-revalidate, no-cache, no-transform, private";
} location /carddavmate/ {
auth_basic off; add_header Cache-Control "max-age=0, must-revalidate, no-cache, no-transform, private"; }
}
On Fri, 28 Feb 2020 19:45:55 +0100, Pierre Couderc pierre@couderc.eu wrote:
I use infcloud with davical with nginx without problem...
Yes, that's the non-CORS option. Not quite what I wanted but at least it works.
BTW, I used
location /infcloud { alias /var/www/infcloud; }
but that's details ;).
-- Johan