[solved] .well-known/caldav check in 13.0.7 explained

Hi! I still don’t quite understand what’s wrong with my setup, if I get a

_* Your web server is not properly set up to resolve “/.well-known/caldav”. _
* Your web server is not properly set up to resolve “/.well-known/carddav”.

message after update to 13.0.7.

My https://cloud.example.com/.well-known/caldav & carddav links forward me to https://cloud.example.com/remote.php/dav just fine, DAV clients works fine. I don’t see any issues after an upgrade except these warnings. I did tried to add the “Redirect 301…” lines to the httpd config, but it didn’t change anything. I have a NC + Apache behind the Traefik proxy.

2 Likes

For me it was an Apache configuration problem. Check out the guide here:

https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#apache-web-server-configuration

My configuration was missing the directory part an thus the .htaccess file was not even used by the server.

1 Like

if you issue solved, could you add [solved] on your first Post in the header.
best regards
Blacky

Thanks for the hint, I finally solved it - in my case the syntax of the redirect in the httpd config had to be:

Redirect 301 /.well-known/carddav https://cloud.example.com/remote.php/dav
Redirect 301 /.well-known/caldav https://cloud.example.com/remote.php/dav

3 Likes

i have the following config in /etc/apache2/sites-available/nextcloud.conf

<VirtualHost *:80>
        
        ServerName cloud.mydomain.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/cloud.mydomain.com

<Directory /var/www/html/cloud.mydomain.com/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/html/cloud.mydomain.com
SetEnv HTTP_HOME /var/www/html/cloud.mydomain.com
Satisfy Any

</Directory>

        Redirect 301 /.well-known/carddav /var/www/html/cloud.mydomain.com/remote.php/dav
        Redirect 301 /.well-known/caldav /var/www/html/cloud.mydomain.com/remote.php/dav

        ErrorLog ${APACHE_LOG_DIR}/cloud.mydomain.com-error.log
        CustomLog ${APACHE_LOG_DIR}/cloud.mydomain.com-access.log combined

</VirtualHost>

and i still have the error bellow

There are some warnings regarding your setup.

* 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/14/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/14/go.php?to=admin-setup-well-known-URL).

Please double check the [installation guides ↗](https://docs.nextcloud.com/server/14/go.php?to=admin-install), and check for any errors or warnings in the [log]

i have my nextcloud instalation behind an apache proxy and i’m using also CloudFlare, any ideea what could be the issue ?

based on this Problem Version 14.0.3 in my /etc/apache2/apache2.conf

i have the following

  <Directory /var/www/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>

and the error it’s still present

i forgot to mention that i had made the update from version 14.0.2 to version 14.0.3 and i have this issue, before there was no issues.

probably you should also correct your

Redirect 301 /.well-known/carddav /var/www/html/cloud.mydomain.com/remote.php/dav

to

Redirect 301 /.well-known/carddav https://cloud.mydomain.com/remote.php/dav

so i changed those 2 lines bellow

Redirect 301 /.well-known/carddav /var/www/html/cloud.mydomain.com/remote.php/dav
        Redirect 301 /.well-known/caldav /var/www/html/cloud.mydomain.com/remote.php/dav

to this

Redirect 301 /.well-known/carddav https://cloud.mydomain.com/remote.php/dav
        Redirect 301 /.well-known/caldav https://cloud.mydomain.com/remote.php/dav

restarted apache and no change the issue it’s still there

maybe i should change it on my proxy vhost settings ?

i tried also to add it in the vhost for cloud on proxy server but the issue it’s still there.

i noticed that inside the nextcloud folder in the .httaccess file i have the following lines

RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]

this suppose to do the job ? but i still have the error

any ideea why this isn’t working ? the error it’s still present.

then want i give you this also to the hand,
i have run my nextcloud as sub behind my domain…
Take a look :

https://domainname.net/nextcloud

/etc/httpd/conf/webapps.d/nextcloud.conf

# nextcloud configuration
Alias /nextcloud /srv/nextcloud
<Directory /srv/nextcloud>
    DirectoryIndex index.html index.php
    AllowOverride All
    Options +FollowSymlinks
    Require all granted
    Header always set Strict-Transport-Security "max-age=31556926; includeSubDomains; preload"
    Header always set Referrer-Policy "no-referrer"
    SetEnv HOME /srv/nextcloud
    SetEnv HTTP_HOME /srv/nextcloud
  <IfModule mod_dav.c>
    Dav off
  </IfModule>
</Directory>
    Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
    Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav

like you see, have i bound in the “Header always set Strict-Transport-Security” also in, as well as “Header always set Referrer-Policy”

in your case should this be

Redirect 301 /.well-known/carddav /remote.php/dav
Redirect 301 /.well-known/caldav /remote.php/dav

because your sub.domain.com is in this case the root so “/” and .well-known/~ is the way to
“/remote.php/dav” so : "cloud.mydomain.com/remote.php/dav "
so must it named ^^

if this works, give feedback…

this could/should be pinned for “Apache-Configuration files”
or build up a Wiki !! :wink:

best regards
Blacky

so i did the change on the vhost where my nexcloud instalation is (behind the proxy) so my vhost looks like this now :

<VirtualHost *:80>
        ServerName cloud.mydomain.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/cloud.mydomain.com

<Directory /var/www/html/cloud.mydomain.com/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/html/cloud.mydomain.com
SetEnv HTTP_HOME /var/www/html/cloud.mydomain.com
Satisfy Any

</Directory>

        Redirect 301 /.well-known/carddav /remote.php/dav
        Redirect 301 /.well-known/caldav /remote.php/dav

        ErrorLog ${APACHE_LOG_DIR}/cloud.mydomain.com-error.log
        CustomLog ${APACHE_LOG_DIR}/cloud.mydomain.com-access.log combined

</VirtualHost>

but the error it’s still present

There are some warnings regarding your setup.

* 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/14/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/14/go.php?to=admin-setup-well-known-URL).

could it be linked to this one here?

i think yes.

I had the same issue and solved it adding the following lines in /etc/apache2/sites-available/nextcloud.conf

    Redirect 301 /.well-known/carddav https://MyServer/nextcloud/remote.php/dav
    Redirect 301 /.well-known/caldav https://MyServer/nextcloud/remote.php/dav
9 Likes

Thank you razcazar, i followed your instructions and everything’s just fine .

Thanks a lot.

1 Like

What do we do for a nginx server?
Do I modify my /etc/nginx/sites-available/nextcloud file?

Solution for Plesk /Apache Nginx.
add in the plesks apache $ nginx settings of your domain under
Additional nginx directives

rewrite ^/.well-known/carddav$ https://yourdomain.tld/remote.php/dav redirect;

rewrite ^/.well-known/caldav$ https://yourdomain.tld/remote.php/dav redirect;
1 Like

I’m a bit confused by that warning, as everything seems to work, but I have to admit, that I’m not using carddav or caldav anyway. This is my setup:

I’m running nextcloud 14.0.3 in a subfolder behind an apache reverse-proxy, thus, on proxy side:
https://cloud.xxxxx.xx ----> 192.168.x.x/nextcloud (no https on the internal host).
This works fine, I get an A+ rating on the security scanner and everything is working.
When I try https://cloud.xxxxx.xx/.well-known/carddav I get redirected to https://cloud.xxxxx.xx/remote.php/dav/ and can see the “Nodes” page from sabre/dav in my browser, so this works too.

I tried:

Redirect 301 /.well-known/carddav https://cloud.xxxxx.xx/remote.php/dav
Redirect 301 /.well-known/caldav https://cloud.xxxxx.xx/remote.php/dav

on both, the proxy and the internal nextcloud server, as well as:

Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav

on the internal nextcloud server.
In every combination I get redirected correctly, but I still get the warning in my settings.

Any idea?