hi - nothing I try seems to be able to make these work right, and I am constantly getting the “your server is not set up to resolve these correctly” error on the NC config page. 25.0.2 on stock Apache from Ubuntu 22.04.
mod_rewrite from the /var/www/html/nextcloud/.htaccess file (the rules are duplicated with and without the leading forward slashes because I can’t tell which one is right, and if it’s wrong, it doesn’t match so who cares):
This problem usually needs a change on the reverse proxy, not the Nextcloud system. Those rewrite lines you posted would be put on an Apache reverse proxy.
I’m not sure, but my understanding was those rules are specifically needed for the reverse proxy. If you look a few paragraphs above that link, that’s what it says.
The redirects for CalDAV or CardDAV does not work if Nextcloud is running behind a reverse proxy. The recommended solution is that your reverse proxy does the redirects.
I don’t use caddy so I can’t help there, but putting that in an Apache reverse proxy definitely resolves it. I’ve done it numerous times.
TBH, this thing is a nightmare. I’ve tried hours and it’s still not working. To the point where I think the test is kinda buggy.
In my case (Apache), webfinger and nodeinfo are correctly resolved but I still have an error message for carddav and caldav. What you could try is requesting the URL using CURL or HTTPie and see what it looks like:
In my case:
http https://mydomain.org/.well-known/carddav
HTTP/1.1 301 Moved Permanently
[…]
It looks fine even if I have the error message on the administration UI
It’s been a long time and this is not strictly related to reverse proxy setup, 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.)