seafile和onlyoffice的https对接并在线访问编辑
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了seafile和onlyoffice的https对接并在线访问编辑相关的知识,希望对你有一定的参考价值。
前面已经把seafile和onlyoffice的https访问都已经配置通,现在就添加seafile对onlyoffice支持1.编辑seafile的conf配置目录seahub_settings.py文件,让其对onlyoffice支持
命令:
vi /usr/local/seafile/conf/seahub_settings.py
添加如下内容:
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = ‘https://域名或IP地址:端口号/web-apps/apps/api/documents/api.js‘
ONLYOFFICE_FILE_EXTENSION = (‘doc‘, ‘docx‘, ‘ppt‘, ‘pptx‘, ‘xls‘, ‘xlsx‘, ‘odt‘, ‘fodt‘, ‘odp‘, ‘fodp‘, ‘ods‘, ‘fods‘)
ONLYOFFICE_EDIT_FILE_EXTENSION = (‘docx‘, ‘pptx‘, ‘xlsx‘,,‘doc‘,‘xls‘,‘ppt‘)
2.在nginx的配置文件seafile.conf添加如下内容
命令:
vi /etc/nginx/conf.d/seafile.conf
在seafile.conf配置文件的开始添加如下内容:
map $http_x_forwarded_proto $the_scheme
default $http_x_forwarded_proto;
"" $scheme;
map $http_x_forwarded_host $the_host
default $http_x_forwarded_host;
"" $host;
map $http_upgrade $proxy_connection
default upgrade;
"" close;
在seafile.conf配置文件中的server段内添加如下内容
location /onlyofficeds/
proxy_pass http://your Seafile server‘s domain or IP:88/;
proxy_http_version 1.1;
client_max_body_size 100M; # Limit Document size to 100MB
proxy_read_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3.编辑seafile配置文件目录conf中的ccnet.conf
命令
vi /usr/local/seafile/conf/ccnet.conf
修改为:SERVICE_URL = https://域名或IP地址:444
4.重启nginx,seafile,seahub服务
命令:
nginx -t
systemctl restart nginx
cd /usr/local/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
4.浏览器访问是否正常访问
5.在线打开doc文件,是否能正常访问并可编辑
以上是关于seafile和onlyoffice的https对接并在线访问编辑的主要内容,如果未能解决你的问题,请参考以下文章
docker版seafile添加office文件预览基于OnlyOffice
docker版seafile添加office文件预览基于OnlyOffice