OnlyOffice 打开文档时提示下载失败

现象:使用内网地址访问onlyoffice时,文档提示下载失败,如图:

问题定位:使用内部ip地址访问后端服务

查看OnlyOffice Converter的日志:docker logs -f 容器名

发现日志文件中存在如下报错:

Error: DNS lookup xxx.xxx.xxx.xx(family:undefined, host:undefined) is not allowed. Because, It is private IP address.

 

解决方式:需要编辑配置文件允许私有ip通过:

编辑docker中/etc/onlyoffice/documentserver/default.json​下的内容:

搜索并修改以下字段为true:

"request-filtering-agent" : {
"allowPrivateIPAddress": true,
"allowMetaIPAddress": true
},

也可以将文件复制出来再进行编辑:

docker cp onlyoffice:/etc/onlyoffice/documentserver/default.json ./
vim default.json

docker cp ./default.json onlyoffice:/etc/onlyoffice/documentserver/default.json

 

更改后,需要重启容器后恢复正常。

 

 

参考:OnlyOffice 打开文档时提示下载失败_onlyoffice 下载失败-CSDN博客

posted @ 2024-01-26 11:24  浪淘沙&  阅读(528)  评论(0编辑  收藏  举报