NC 23.0.0 – Your web server is not properly set up to resolve

After installing NC 23, I am not able to get rid of these four warnings:

Your web server is not properly set up to resolve "/.well-known/webfinger".
Your web server is not properly set up to resolve "/.well-known/nodeinfo".
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".

I know this issue has been discussed elsewhere, but I really wonder whether there might be a bug in the automatic checks.

My setup is the following. I am running Apache2 on Ubuntu and my nextcloud files sit in /var/www/nc/. I have set an Alias as described in Apache Web server configuration such that nextcloud is reachable on my server via https://mydomain.com/nc. Basically, everything seems to work fine, except for the above-mentioned warnings.

In the file /var/www/nc/.htaccess I have modified/placed these lines:

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

In order to test the settings, I run wget https://mydomain.com/nc/.well-known/carddav on an other computer. This produces a 401 Unauthorized error. When I change the RewriteRule path to something else, e.g. /remote.php/dav/, I get the error ERROR 404: Not Found. So I think that the resolving actually works fine.

Going forward, I have got three questions:

  1. Is it possible that the automatic checks in NC23 are faulty?
  2. I did modify lines in /var/www/nc/.htaccess although there is a warning #### DO NOT CHANGE ANYTHING ABOVE THIS LINE #### saying I should not do that. But where else could/should I have modified the RewriteRules?
  3. If the automatic checks in NC23 are actually correct, does anyone see a way to rectify these warnings?

Thanks so much for your help!

Have you read this?

Read also this. Sorry german.

Thanks for the hints! I had actually read the first reference, but it did not help.

The second one might have worked. However, I decided to try it differently.

For anyone who might run into the same issue and is at liberty to change the server setup: It seems to be much easier to access nextcloud via a virtual host for a subdomain. Everything worked right out of the box.

On different server, I actually faced the same problem. It seems to always occur when the nextcloud folder is not the webroot folder.

What helped me was putting the following code into the virtual host configuration:

RewriteEngine on
RewriteRule ^/\.well-known/carddav /nc/remote.php/dav [R=301,L]
RewriteRule ^/\.well-known/caldav /nc/remote.php/dav [R=301,L]
RewriteRule ^/\.well-known/webfinger /nc/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^/\.well-known/nodeinfo /nc/index.php/.well-known/nodeinfo [R=301,L]

The difference with respect to General troubleshooting > Service discovery is that I placed a slash after every caret in the RewriteRules.

I have the same warnings and apparently nothing i do fixes them. My .htaccess looks like below

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

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

  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

I’m a bit lost, you guys have any idea?

Hello, I’ve just had a similar problem with Nextcloud Hub 3 v25.0.5

I tried to modify the .htaccess but nothing worked.

So eventually after reading the links from previous comments, I figured out that the problem might be that I’m running the Nextcloud server in https, and I started to check the Apache2 site configuration files instead.

I found out that there are some redirections directly there, so perhaps the in my case the redirections are handled by the Apache config file rather than the .htaccess?

So in that file I made sure to add the webfinger and nodeinfo redirections as follows and then restarted apache2. After that I have no more complains from Nextcloud status:

        <VirtualHost *:443>
Redirect 301 /.well-known/carddav /remote.php/dav
Redirect 301 /.well-known/caldav /remote.php/dav
Redirect 301 /.well-known/webfinger /index.php/.well-known/webfinger
Redirect 301 /.well-known/nodeinfo /index.php/.well-known/nodeinfo

I hope it helps.

4 Likes

thanks. It worked for me too. I have my NC in https.