当前位置:   article > 正文

docker运行onlyoffice,并配置https访问【参考仅用】

docker运行onlyoffice,并配置https访问【参考仅用】

官方说明:

Installing ONLYOFFICE Docs for Docker on a local server - ONLYOFFICEicon-default.png?t=N7T8https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx


一、容器端口、目录卷映射

  1. sudo docker run --name=容器名称 --restart=always -i -t -d
  2. -p 443:443
  3. -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data
  4. onlyoffice/documentserver

        这里需要映射443端口,并且映射docker的/var/www/onlyoffice/Data目录,用于存放ssl证书。

二、ssl证书配置

        将 onlyoffice.key 和 onlyoffice.crt 格式的证书放到【宿主机】的/app/onlyoffice/DocumentServer/data/certs/目录下,因为刚才映射过了,注意证书文件名称一定是 onlyoffice.key 和 onlyoffice.crt ,否则启动报错,或者进入docker容器中,将nginx的配置文件的证书名称改掉。

三、重启docker容器

sudo docker restart 容器名称

四、如果报错 the document could not be saved

the document could not be saved,please check connection settings or concat your administrator.

查看下容器日志:

[2023-11-15T11:42:30.934] [ERROR] [localhost] [192.168.101.26new__1_.xlsx1700048549299] [uid-1] nodeJS - postData error: url = https://192.168.101.111/example/track?filename=new%20(1).xlsx&useraddress=192.168.101.26;data = {"key":"192.168.101.26new__1_.xlsx1700048549299","status":1,"users":["uid-1"],"actions":[{"type":1,"userid":"uid-1"}],"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiIxOTIuMTY4LjEwMS4yNm5ld19fMV8ueGxzeDE3MDAwNDg1NDkyOTkiLCJzdGF0dXMiOjEsInVzZXJzIjpbInVpZC0xIl0sImFjdGlvbnMiOlt7InR5cGUiOjEsInVzZXJpZCI6InVpZC0xIn1dLCJpYXQiOjE3MDAwNDg1NTAsImV4cCI6MTcwMDA0ODg1MH0.o1kkVun-SGl3MgM-SoPsGn_Rbw3-SagZQvneoZ8ENpM"} 

Error: self signed certificate

    at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)

    at TLSSocket.emit (events.js:400:28)

    at TLSSocket._finishInit (_tls_wrap.js:937:8)

    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12)

可以看到报错原因是:Error: self signed certificate

解决方案:

将/etc/onlyoffice/documentserver/default.json文件中的rejectUnauthorized字段值改为false

然后,重启容器

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/139751
推荐阅读
相关标签
  

闽ICP备14008679号