§2024-07-09

Your web server is not properly set up to resolve .well-known URLs, failed on: /.well-known/caldav For more details see the documentation ↗.

Check Configuration Files: Ensure your Nextcloud configuration file (config/config.php) includes correct settings for the overwrite.cli.url parameter. It should point to your Nextcloud URL, including https:// if applicable.

Example:

'overwrite.cli.url' => 'https://your-nextcloud-domain.com',

Web Server Configuration: Modify your web server configuration to include rules that allow .well-known URLs to be resolved properly. Below are examples for Apache and Nginx:

Apache Configuration (.htaccess or Virtual Host):

  1. edit as
<VirtualHost *:48501>
    ServerName n2Bookworm.yushei.net
    DocumentRoot /var/www/nextcloud/

    # log files
    ErrorLog /var/log/apache2/n2Bookworm.yushei.net-error.log
    CustomLog /var/log/apache2/n2Bookworm.yushei.net-access.log combined

    <Directory /var/www/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All

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

        <IfModule mod_headers.c>
            Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
        </IfModule>

        SetEnv HOME /var/www/nextcloud
        SetEnv HTTP_HOME /var/www/nextcloud

        <IfModule mod_rewrite.c>
            RewriteEngine on
            RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
            RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
            RewriteRule ^\.well-known/webfinger /public.php?service=webfinger [QSA,L]
            RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
            RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
        </IfModule>
    </Directory>
</VirtualHost>
  1. /sbin/a2enmod and restart apache2
# /sbin/a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2
root@hc4Bookworm:/home/alexlai# systemctl restart apache2

a2enmod is a command-line utility in Debian-based systems (such as Ubuntu) used to enable Apache modules. Apache modules are pieces of software that extend the capabilities of the Apache HTTP Server. By default, some modules may be installed but not enabled, and a2enmod allows you to enable these modules without manually editing configuration files.