By 大伟哥 |
有了Zerotier这个好用的工具以后,原本不在同一个局域网里的多台电脑互相访问就很方便了,这给我们的数据备份和同步带来了很大的便利。大伟哥原来只是通过Nextcloud在局域网范围内同步重要数据的,现在可以扩展到任何可以联网的地方了。
这里会碰到一个问题,因为Zerotier给每台设备指定的IP地址和原来局域网里面的IP地址是不一样的,如果一台设备不在局域网内,只能通过ZeroTier分配的IP地址访问到Nextcloud的服务器,这时候原来默认安装的Nextcloud就会拒绝访问,提示“通过不被信任的域名访问”。
Nextcloud文档的相关内容如下:
All URLs used to access your Nextcloud server must be whitelisted in yourconfig.php file, under the trusted_domains setting. Users are allowed to log into Nextcloud only when they point their browsers to a URL that is listed in the trusted_domains setting. You may use IP addresses and domain names. A typical configuration looks like this:
'trusted_domains' => array ( 0 => 'localhost', 1 => 'server1.example.com', 2 => '192.168.1.50', 3 => '[fe80::1:50]', ),
这就很简单了,找到配置文件/config/config.php,在trusted_domains再插入一条Zerotier分配的IP地址,问题就解决了。
- 添加新评论
- 8519 阅读
评论
谢谢,有用。
添加新评论