Your web server is not properly set up to resolve "/.well-known/webfinger"

The administration overview shows:

There are some warnings regarding your setup.

  • Your web server is not properly set up to resolve “/.well-known/webfinger”. Further information can be found in the documentation :arrow_upper_right:.
  • Your web server is not properly set up to resolve “/.well-known/nodeinfo”. Further information can be found in the documentation :arrow_upper_right:.

Please double check the installation guides :arrow_upper_right:, and check for any errors or warnings in the log.

This error has been asked about on GitHub and this forum for many times, but none of them contains a valid solution. Most of them just contain people saying that /.well-known/webfinger should be redirected to /index.php/.well-known/webfinger. However, I already set this up. I can see that there is a 301 redirection to the expected location when I run

curl -Lv https://my-domain.com/.well-known/webfinger

The result is 404 with body

{"message":"nodeinfo not supported"}

and the header contains X-NEXTCLOUD-WELL-KNOWN: 1.

Actually, I think the most probable situation is that this is a Nextcloud’s bug that falsely reports this warning about resolving webfinger.

The same for nodeinfo.

Nextcloud version: 27.1.1 (docker)