Nextcloud管理页面上的警告/.well-known/webfinger /.well-known/nodeinfo处理方法

文章2022-06-05

测试环境:Nextcloud + Nginx

Nextcloud管理页面上的警告:

您的网页服务器未正确设置以解析”/.well-known/webfinger”。更多信息请参见文档
您的网页服务器未正确设置以解析”/.well-known/nodeinfo”。更多信息请参见文档

Nextcloud管理页面上的警告/.well-known/webfinger /.well-known/nodeinfo处理方法-下一朵云
图1 安全与设置警告

解决办法:

官方手册 https://docs.nextcloud.com/server/21/admin_manual/installation/nginx.html

1.确认Nginx已经开启rewrite功能

2.检查Nginx的配置文件或vhost的配置文件,确认存在以下内容

location ^~ /.well-known {

        rewrite ^/\.well-known/webfinger        /public.php?service=webfinger       last;
        rewrite ^/\.well-known/nodeinfo         /public.php?service=nodeinfo        last;

    }

测试使用如下图

Nextcloud管理页面上的警告/.well-known/webfinger /.well-known/nodeinfo处理方法-下一朵云
图2 添加配置内容

3.重启Nginx或者使用./ningx -s reload重载配置

4.再次访问后台管理页面ctrl+F5刷新后警告消失

Nextcloud管理页面上的警告/.well-known/webfinger /.well-known/nodeinfo处理方法-下一朵云
图3 刷新后警告消失

5.说明,如果配置以上步骤未生效,请尝试将/public.php?service=webfinger last;/public.php?service=nodeinfo last;中的/public.php替换为public.php的绝对路径,例如/srv/www/nextcloud/public.php?service=webfinger

Nextcloud管理页面上的警告/.well-known/webfinger /.well-known/nodeinfo处理方法-下一朵云
图4 设置绝对路径

6.如果使用的APACHE(httpd)的web服务器

在nextcloud目录下.htaccess文件最后添加如下内容

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ https://%{SERVER_NAME}/remote.php/webdav/ [L,R=302]
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/host-meta https://%{SERVER_NAME}/public.php?service=host-meta [QSA,L]
RewriteRule ^\.well-known/host-meta\.json https://%{SERVER_NAME}/public.php?service=host-meta-json [QSA,L]
RewriteRule ^\.well-known/webfinger https://%{SERVER_NAME}/public.php?service=webfinger [QSA,L]
RewriteRule ^\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
RewriteRule ^remote/(.*) https://%{SERVER_NAME}/remote.php [QSA,L]
RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

如果以上尝试都未生效,也可以尝试关掉此项检查警告,方法为在 Nextcloud 目录下 /config/config.php 文件中添加一行

'check_for_working_wellknown_setup' => false,
版权声明:本文为下一朵云发布文章,转载请附上原文出处链接和本声明。
本文链接:https://www.orcy.net.cn/1275.html

​ 广告:HCIE-Security认证课程辅导资料(付费)

2 条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注