I’m going over issues in my Nextcloud (18.0.4 – just updated) & this is one of the few issues left!
* Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the [documentation](https://docs.nextcloud.com/server/18/go.php?to=admin-setup-well-known-URL).
* Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the [documentation](https://docs.nextcloud.com/server/18/go.php?to=admin-setup-well-known-URL).
I’m using manual install on Ubuntu Server 18.04 (headless) with Apache2 & the NC home path is “/var/www/nextcloud”
Hi.
I’ve got the same issue, did you ever resolve this problem?
When I look in the documents, if you have your nextcloud in a subfolder, you should add this behind the well-known lines.
I never did get it working. Honestly it’s been a while since I’ve looked at this…but if you ever find a solution, feel free to post it! I’d much appreciate it
@Adriaan_van_Vliet It looks like the difference between your entry and my entry is the “/” in the characters: ^/\. I’ll give that a try! Glad to have something concrete to try! With any luck, it’ll even work
@Adriaan_van_Vliet sorry to leave you hanging. But I am trying to upgrade to NC 21 right now, and haven’t had a chance to try this. Currently stuck on a php error where I should see NC…
Just wanted to report back for the sake of closure. Upgrading ended up being a total nightmare (new php → new host OS → not a simple upgrade). So I ended up creating a new host for Nextcloud & just pointing to the same config files & database & data & all that. Apparently this issue fixed itself.
By that I actually mean two related but distinct things. When I first installed Nextcloud 21, I had a list of issues in the management tab, including 4 (not just the 2 I was used to) related to well-known. I ran a few of the fixes, but did nothing to address these specifically before going to bed. When I checked on it the next morning, all the “well-known” issues were fixed.
So I guess it’s solved? Not sure how (unless they made a change to the config file)–but I’m not looking a gift horse in the mouth!
Regardless, I appreciate the help & didn’t want to leave you hanging!
Update for NC 21 (relevant for previous versions as well):
I had the same issue, but in my experience it’s always an issue of having the proper rewrite rules set in your server configuration. Adrian’s solution should work for any version; for SSL:
Well, for what it’s worth, here is my “solution” to get all of the rewrites to work.
Basically it’s @Adriaan_van_Vliet 's solution of calling the server-URL during rewrites.
I’m currently running NC 25.0.3 on Debian 11.
Installation directory of NC is “/var/www/nextcloud”
The changes I made were made to the file “/var/www/nextcloud/.htaccess”
These changes were to edit the file to include the following rewrites:
"
RewriteRule ^\.well-known/carddav http(s)://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav http(s)://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/webfinger http(s)://%{SERVER_NAME}/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^\.well-known/nodeinfo http(s)://%{SERVER_NAME}/index.php/.well-known/nodeinfo [R=301,L]
"
Please make sure to adapt the “http(s)://%{SERVER_NAME}”-part to match your own situation.
I hope this helps someone and thanks to @Adriaan_van_Vliet again for originally posting this solution in the first place.
Adding @LordMort’s & @Adriaan_van_Vliet’s ‘solution’ to our Apache vhost fixed this “web server is not properly set up” warning in our Nextcloud Hub 4 (26.0.1) setup on Debian 11.6.
For HAProxy users, a shorter rewrite that also fixes these warnings;
In fact I struggled a long time with the right syntax for some trailing or leading slash being wrong on my Linux based host.
.htaccess:
php_value open_basedir none
<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteLog "/var/log/apache2/rewrite.log"
#RewriteLogLevel 3
# If your Nextcloud instance is installed in a subfolder called nextcloud
# and you're running Apache create or edit the .htaccess file within the document root
# of your Web server and add the following lines:
# https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#service-discovery
RewriteRule ^\.well-known/carddav https://%{SERVER_NAME}/nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/caldav https://%{SERVER_NAME}/nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/webfinger https://%{SERVER_NAME}/nextcloud/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^\.well-known/nodeinfo https://%{SERVER_NAME}/nextcloud/index.php/.well-known/nodeinfo [R=301,L]
</IfModule>
Obviously the https://%{SERVER_NAME} prefix is/was not strictly necessary in my case, though it would redirect clients to the secure https:// protocol for sure, which is a good thing [TM].
But the trailing slash after /nextcloud/remote.php/dav/ was superfluous in my case and it worked only after I removed that from the examples given here, there and elsewhere before.
Just to add some information to this thread. I solved the problem by adding the following to the nextcloud-le-ssl.conf file in /etc/apache2/sites-available.
People who actually know what they’re doing may want to criticise this as I’m just starting and floundering around, but it worked and got rid of the error message in my profile Administration overview. I hope this helps someone
It’s been a long time and this is not strictly related to caldav and carddav, but for those who still struggle with the issue regarding the redirection of /.well-known services and find this thread through a web search, they might find some additional information on why the tests for webfinger and nodeinfo might fail despite correct redirection in my comment here.
(Apologies for the noise.)
I am also having similar problems. Maybe someone can help.
I am using yunohost to self-host 2 different Nextcloud instances on the same server. Let’s call the domain for the first instance www.domainA.com and the second www.domainB.com.
I am not able to connect to the CalDav on the second instance.
On my server, the file path to the first instance of nextcloud is /var/www/nextcloud/ and the file path to the second instance of Nextcloud is /var/www/nextcloud__2/
For what it is worth, if I use a web browser and go www.domainB.com/.well-known/caldav
I am redirected to the webdav interface and after entering my user credentials I see “This is the WebDAV interface, so I know the self-service discovery.