Office 文档在线编辑搭建教程
Collabora Online
Collabora Online 是一款强大的在线办公套件,支持多种文档、表格、演示文稿等文件格式的在线查看、编辑、实时协作,且能与多种云解决方案集成,可在多种操作系统的浏览器上运行,保障数据安全与隐私。
安装
使用 Docker 部署 Collabora Online(官方文档):
docker pull collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 \
-e "aliasgroup1=<Cloudreve地址,例如https://demo.cloudreve.org>" \
-e "username=<面板管理员用户名>" \
-e "password=<面板管理员密码>" \
--name code --restart always collabora/code
启动成功后开始设置反代
宝塔设置Nginx反代
新建一个站点并绑定域名,并成功申请SSL证书。
然后点击配置文件,将下方Nginx反代代码粘贴到server{}中。
# static files
location ^~ /browser {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# Capabilities
location ^~ /hosting/capabilities {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# main websocket
location ~ ^/cool/(.*)/ws$ {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
# download, presentation and image upload
location ~ ^/(c|l)ool {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# Admin Console websocket
location ^~ /cool/adminws {
proxy_pass https://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
查看 XML 响应
https://你的域名/hosting/discovery
OnlyOffice
docker run -i -t -d -p 8080:80 -e WOPI_ENABLED=true onlyoffice/documentserver
然后访问:ip:端口/hosting/discovery