Docker + Swag, Your web server is not properly set up to resolve `.well-known` URLs

Nextcloud version (eg, 29.0.5): Nextcloud Hub 8 (29.0.2)
Operating system and version (eg, Ubuntu 29.04): Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-112-generic x86_64)
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

The issue you are facing:
I’m using nextcloud via docker with SWAG, I’m trying to resolve this setup warning,

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

right now if I go to my nextcloud URL
https://myurl/.well-known/carddav
or,
https://myurl/.well-known/caldav

it takes me to,
https://myurl/nextcloud/remote.php/dav/
which shows,
“This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client.”

However, with
https://myurl/nextcloud/.well-known/caldav (or carddav)
I get taken to
https://myurl/remote.php/dav/

my nginx nextcloud.subfolder.conf file,

# more nextcloud.subfolder.conf
## Version 2023/02/05
# make sure that your nextcloud container is named nextcloud
# make sure that nextcloud is set to work with the base url /nextcloud/
# Assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwritewebroot' => '/nextcloud',
#  'overwrite.cli.url' => 'https://example.com/nextcloud',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'example.com',
#  ),

location ^~ /.well-known {
    # The rules in this block are an adaptation of the rules
    # in the Nextcloud `.htaccess` that concern `/.well-known`.

    location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
    location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }

    # Let Nextcloud's API for `/.well-known` URIs handle all other
    # requests by passing them to the front-end controller.
    return 301 /nextcloud/index.php$request_uri;
}

location ^~ /nextcloud/ {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app nextcloud;
    set $upstream_port 443;
    set $upstream_proto https;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    rewrite /nextcloud(.*) $1 break;
    proxy_hide_header X-Frame-Options;
    proxy_max_temp_file_size 2048m;
    proxy_set_header Range $http_range;
    proxy_set_header If-Range $http_if_range;
    proxy_ssl_session_reuse off;
}

I’m guessing to get rid of the setup warning message I need to have the
https://myurl/nextcloud/.well-known/caldav
url take me to the right location, but I’m not sure how to get that to happen.

Добрый день, у меня версия 29.0.0.2, использую nginx proxy manager, после появления данной проблемы помогла замена:

location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }

на:

location = nextcloud/.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
location = nextcloud/.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }
1 Like

Thanks, sadly that just made me unable to access Nextcloud at the normal address.