- docker部署OnlyOffice环境
- 在前端项目
index.html
文件中加入外部js文件,链接必须为固定的ip或者域名,不可以用localhost
或者127.0.0.1
<script type="text/javascript" src="https://onlyoffice.gudu.fun/web-apps/apps/api/documents/api.js"></script>
- 前端组件集成OnlyOffice,详见
https://vue-demo.gudu.fun/OnlyOffice
- nginx转发OnlyOffice
server {
listen 80;
listen 443 ssl;
server_name onlyoffice.gudu.fun;
# 增加ssl
ssl on;
ssl_certificate /ssl/onlyoffice.gudu.fun.pem;
ssl_certificate_key /ssl/onlyoffice.gudu.fun.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
# 指定密码为openssl支持的格式
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# 密码加密方式
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
# 依赖SSLv3和TLSv1协议的服务器密码将优先于客户端密码
ssl_prefer_server_ciphers on;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
location / {
proxy_pass http://ip:port;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
- 处理文档安全令牌未正确形成的问题
## 更改/etc/onlyoffice/documentserver/local.json
docker exec -it [容器id] bin/bash
cd /etc/onlyoffice/documentserver
sed -i 's/true/false/g' local.json
supervisorctl restart all
# To Be Continued!😎
← Vue展示树形数据 Vue实现动态组件引入 →