From fe1b69d0f7b6cc4c0d076c64336e7a050c6b725a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 28 May 2016 21:12:12 +0200 Subject: [PATCH] [fix] Serve .well-known paths at the root to be discovered --- README.md | 2 +- conf/nginx.conf | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b8503e4..dc96701 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ this package: * Integrate with YunoHost users and SSO - i.e. logout button * Allow one user to be the administrator (set at the installation) * Optionally access the user home folder from ownCloud files (set at the installation) - * Serve `.well-known` paths for CalDAV and CardDAV - note that they are relative to the installation path + * Serve `/.well-known` paths for CalDAV and CardDAV on the domain ## Limitations diff --git a/conf/nginx.conf b/conf/nginx.conf index f00a8c9..9c31380 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,3 +1,10 @@ +location = /.well-known/carddav { + return 301 https://$server_name#PATH#/remote.php/dav; +} +location = /.well-known/caldav { + return 301 https://$server_name#PATH#/remote.php/dav; +} + location #LOCATION# { alias #DESTDIR#/; @@ -25,10 +32,6 @@ location #LOCATION# { error_page 403 #PATH#/core/templates/403.php; error_page 404 #PATH#/core/templates/404.php; - # Rules for served well-known paths - rewrite ^#PATH#/.well-known/carddav #PATH#/remote.php/dav/ permanent; - rewrite ^#PATH#/.well-known/caldav #PATH#/remote.php/dav/ permanent; - # The following 2 rules are only needed for the user_webfinger app. # Uncomment it if you're planning to use this app. #rewrite ^#PATH#/.well-known/host-meta #PATH#/public.php?service=host-meta last;