I’m curious about the solution to this as well, I copied exactly the example nginx config from the documentation:
location ^~ /.well-known {
# The rules in this block are an adaptation of the rules
# in `.htaccess` that concern `/.well-known`.
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
return 301 /index.php$request_uri;
}
But I still have those errors complaining that webfinger, nodeinfo, carddav, and webdav aren’t set up properly.
I can also curl /.well-known/nodeinfo and see that the nginx config is correctly 301 redirecting to /index.php/.well-known/nodeinfo:
curl 'https://nextcloud.mydomain.com/.well-known/nodeinfo' -D -
HTTP/2 301
content-type: text/html
date: Thu, 25 Apr 2024 00:49:29 GMT
location: http://nextcloud.mydomain.com/index.php/.well-known/nodeinfo
referrer-policy: no-referrer
server: nginx
strict-transport-security: max-age=15768000; includeSubDomains; preload;
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-robots-tag: noindex, nofollow
x-xss-protection: 1; mode=block
content-length: 162
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
But if I do curl -L so that it follows the redirect, the url at http://nextcloud.mydomain.com/index.php/.well-known/nodeinfo returns a 404 the message “nodeinfo not supported”:
curl 'https://nextcloud.mydomain.com/.well-known/nodeinfo' -L -D -
HTTP/2 301
content-type: text/html
date: Thu, 25 Apr 2024 00:51:20 GMT
location: http://nextcloud.mydomain.com/index.php/.well-known/nodeinfo
referrer-policy: no-referrer
server: nginx
strict-transport-security: max-age=15768000; includeSubDomains; preload;
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-robots-tag: noindex, nofollow
x-xss-protection: 1; mode=block
content-length: 162
HTTP/2 404
cache-control: no-cache, no-store, must-revalidate
content-security-policy: default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'
content-type: application/json; charset=utf-8
date: Thu, 25 Apr 2024 00:51:20 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
feature-policy: autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
pragma: no-cache
referrer-policy: no-referrer
server: nginx
set-cookie: oc_sessionPassphrase=xxxxxx; path=/; secure; HttpOnly; SameSite=Lax
set-cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
set-cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
set-cookie: xxxxx=xxxxx; path=/; secure; HttpOnly; SameSite=Lax
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-nextcloud-well-known: 1
x-permitted-cross-domain-policies: none
x-request-id: 5rcPEkbguHe2IY9Zubdi
x-robots-tag: noindex, nofollow
x-robots-tag: noindex, nofollow
x-xss-protection: 1; mode=block
content-length: 36
{"message":"nodeinfo not supported"}%
So it seems like the .well-known resolves correctly, it’s just that it gives a 404 at that url. Maybe that’s just because I don’t have any federation plugins installed, but then the error message should be saying “you don’t have any federation stuff installed” instead of saying “your web server is not set up to resolve .well-known”…