点击展开更新日志
源起
随着设备的增多,数据备份、同步成为一个问题,最开始是采用端对端的同步方式,后面发现还是不太方方便,因此在网上溜达,决定部署 nextcloud 进行管理。
另外,算是一个声明吧:按照本文部署步骤基本上不会有什么大问题(但谁又能保证没问题呢🙄,毕竟不是一步步边执行边写的,小问题或许很多,发现了再改),毕竟是在部署完成后根据现有内容写的教程,不确保哪里会有遗漏,如果真有问题,提供几个排查思路:
F12
查看请求返回情况,看 Network
和 Console
查看各个 容器日志是否正常,必要时调整日志级别协助排查。其中 Nextcloud 应用要查看 data/nextcloud.log
更有用
使用 DS 等大模型工具和谷歌
所有配置和命令务必 根据实际情况进行调整,如果觉得我的还不错直接执行自然没问题。存在疑问的部分有限查看 情况说明 部分是否有提及,如果没有就借助搜索工具自行获取答案。
Nextcloud 是什么
关于介绍自然官网最详细,简言之,就是自建网盘,支持在线共享编辑,多设备多用户同步。本文主要说明一下怎么安装,具体功能及使用得后续实际用起来之后再补充,前前后后也算折腾了一个多礼拜,总算基本清楚了。
部署
❕:20250530,使用该 docker-compose.yml
文件重新在新的环境部署了一遍,拷贝相关配置,启动一次性成功,基本可以保证按照本文操作没有什么大问题,但这并不是100%,请知悉!
创建数据目录
我的所有容器数据都放在 /data/Containers
目录下,因此基于此目录进行配置:
1 mkdir -p /data/Containers/nextcloud/{config,data,html,mysql/data,nginx/ssl,php-fpm,redis/data,redis/conf}
config
配置目录
data
数据保存目录。我的数据盘在 windows 上,因此后面会基于这个目录挂载上去
html
nextcloud 主程序数据目录
mysql
数据库文件和配置
nginx
nginx 配置
php-fpm
php 配置
redis
redis 配置
权限配置
如果权限配置不正确,可能会有很多奇奇怪怪的问题,这里仅提供目前我的配置,至于是否存在多余,是否不必要,已不想考究,感兴趣就自己试试:
目录权限
1 2 cd /data/Containers/nextcloudchown www-data:www-data -R config data html
用户映射
1 2 3 4 vim /etc/subuid www-data:100000:82 www-data:33:1
准备 SSL 证书
不负责任地说,我有本地域名的 SSL 证书,所以这一步就很简单。
暂时可以用 openssh
自签一张用于系统调整,最后再申请免费证书进行替换。
Nginx 配置
Nextcloud Nginx 配置示例 · GitHub
仅添加 user
配置,其它可以不修改。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 worker_processes auto; user www-data www-data; error_log logs/error.log warn; pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; types { text/javascript mjs; application/wasm wasm; } log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ; access_log logs/access.log main; sendfile on; server_tokens off; keepalive_timeout 65; map $arg_v $asset_immutable { "" "" ; default ", immutable" ; } upstream php-handler { server nextcloud:9000; } server { listen 443 ssl; listen [::]:443 ssl; server_name nextcloud.evergardenviolet.top; http2 on; add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; client_max_body_size 512M; client_body_timeout 300s; fastcgi_buffers 64 4K; client_body_buffer_size 512k; gzip on; gzip_vary on; gzip_comp_level 4; gzip_min_length 256; gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; add_header Referrer-Policy "no-referrer" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Robots-Tag "noindex, nofollow" always; add_header X-XSS-Protection "1; mode=block" always; fastcgi_hide_header X-Powered-By; root /var/www/html; ssl_certificate /usr/local/openresty/nginx/ssl/cert.crt; ssl_certificate_key /usr/local/openresty/nginx/ssl/key.pem; index index.php index.html /index.php$request_uri ; location = / { if ( $http_user_agent ~ ^DavClnt ) { return 302 /remote.php/webdav/$is_args$args ; } } location = /robots.txt { allow all; log_not_found off; access_log off; } location ^~ /.well-known { location = /.well-known/carddav { return 301 /remote.php/dav/; } location = /.well-known/caldav { return 301 /remote.php/dav/; } location = /.well-known/webfinger { return 301 /index.php/.well-known/webfinger; } location = /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo; } location /.well-known/acme-challenge { try_files $uri $uri / =404; } location /.well-known/pki-validation { try_files $uri $uri / =404; } return 301 /index.php$request_uri ; } location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } location ~ \.php(?:$|/) { rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri ; fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info ; try_files $fastcgi_script_name =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ; fastcgi_param PATH_INFO $path_info ; fastcgi_param modHeadersAvailable true ; fastcgi_param front_controller_active true ; fastcgi_pass php-handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; fastcgi_max_temp_file_size 0; } location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ { try_files $uri /index.php$request_uri ; add_header Cache-Control "public, max-age=15778463$asset_immutable " ; add_header Referrer-Policy "no-referrer" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Robots-Tag "noindex, nofollow" always; add_header X-XSS-Protection "1; mode=block" always; access_log off; } location ~ \.(otf|woff2?)$ { try_files $uri /index.php$request_uri ; expires 7d; access_log off; } location /remote { return 301 /remote.php$request_uri ; } location / { try_files $uri $uri / /index.php$request_uri ; } } }
PHP 配置
关键配置:
1 2 3 4 5 6 [www] user = www-data group = www-data listen = 127.0.0.1:9000 listen = 192.168.7.100:9000
其中 192.168.7.100
是 docker 宿主机地址。
Redis 配置
1 2 3 4 5 6 7 8 user default off user admin on >admin@123 ~* +@all user nextcloud on >nextcloud2025 ~* +@read +@write +@scripting +@connection bind 0.0.0.0supervised systemd loglevel notice
创建容器
创建变量
1 2 cd /data/Containers/nextcloudvim .env
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 MYSQL_ROOT_PASSWORD="mysql_pass" MYSQL_DATABASE=nextcloud MYSQL_USER=nextcloud MYSQL_PASSWORD="mysql_pass" MYSQL_CNF=/data/Containers/nextcloud/mysql/conf MYSQL_DATA=/data/Containers/nextcloud/mysql/data REDIS_DATA=/data/Containers/nextcloud/redis/data REDIS_CONF=/data/Containers/nextcloud/redis/config/redis.conf REDIS_HOST_USER=nextcloud REDIS_HOST_PASSWORD="redis2025" NEXTCLOUD_ADMIN_USER=admin NEXTCLOUD_ADMIN_PASSWORD="admin123" NEXTCLOUD_TRUSTED_DOMAINS="nextcloud.domain.com" OVERWRITECLIURL="https://nextcloud.domain.com" NEXTCLOUD_HTML=/data/Containers/nextcloud/html NEXTCLOUD_DATA=/data/Containers/nextcloud/data NEXTCLOUD_CONFIG=/data/Containers/nextcloud/config NEXTCLOUD_PHP_CONF=/data/Containers/nextcloud/php-fpm/www.conf NGINX_CONF=/data/Containers/nextcloud/nginx/nginx.conf NGINX_HTML=/data/Containers/nextcloud/html NGINX_SSL=/data/Containers/nextcloud/nginx/ssl
docker-compose.yml
第一次执行时需要注释 external: "true"
这行以创建网络,从第二次开始需要取消注释。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 services: mysql: container_name: Nextcloud-fpm-mysql image: mysql:lts command: --transaction-isolation=READ-COMMITTED env_file: .env environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} volumes: - ${MYSQL_CNF}:/etc/mysql/my.cnf - ${MYSQL_DATA}:/var/lib/mysql:Z networks: - nextcloud restart: unless-stopped redis: container_name: Nextcloud-fpm-redis image: redis:latest command: redis-server /etc/redis/redis.conf env_file: .env volumes: - ${REDIS_DATA}:/data - ${REDIS_CONF}:/etc/redis/redis.conf networks: - nextcloud restart: unless-stopped nextcloud: container_name: Nextcloud-fpm-app hostname: nectcloud image: nextcloud:production-fpm-alpine env_file: .env environment: MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} MYSQL_HOST: mysql REDIS_HOST: redis REDIS_HOST_PORT: 6379 REDIS_HOST_USER: ${REDIS_HOST_USER} REDIS_HOST_PASSWORD: ${REDIS_HOST_PASSWORD} NEXTCLOUD_ADMIN_USER: ${NEXTCLOUD_ADMIN_USER} NEXTCLOUD_ADMIN_PASSWORD: ${NEXTCLOUD_ADMIN_PASSWORD} NEXTCLOUD_UPDATE: 1 NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_TRUSTED_DOMAINS} APACHE_DISABLE_REWRITE_IP: 1 OVERWRITEPROTOCOL: https OVERWRITECLIURL: ${OVERWRITECLIURL} PHP_MEMORY_LIMIT: 1024M PHP_UPLOAD_LIMIT: 1024M volumes: - ${NEXTCLOUD_HTML}:/var/www/html - ${NEXTCLOUD_DATA}:/var/www/html/data - ${NEXTCLOUD_CONFIG}:/var/www/html/config - ${NEXTCLOUD_PHP_CONF}:/usr/local/etc/php-fpm.d/www.conf networks: - nextcloud restart: unless-stopped web: image: openresty/openresty container_name: Nextcloud-fpm-openresty env_file: .env restart: unless-stopped ports: - 8082 :443 volumes: - ${NGINX_CONF}:/usr/local/openresty/nginx/conf/nginx.conf - ${NGINX_HTML}:/var/www/html:z - ${NGINX_SSL}:/usr/local/openresty/nginx/ssl depends_on: - nextcloud networks: - nextcloud cron: image: nextcloud:fpm-alpine container_name: Nextcloud-fpm-cron restart: unless-stopped env_file: .env volumes: - ${NEXTCLOUD_HTML}:/var/www/html:z - ${NEXTCLOUD_DATA}:/var/www/html/data - ${NEXTCLOUD_CONFIG}:/var/www/html/config entrypoint: /cron.sh depends_on: - mysql - redis networks: - nextcloud networks: nextcloud: driver: bridge name: nextcloud external: "true"
反向代理
使用的是 Nginx Proxy Manager
,
配置转发到指向后端服务器的 8082
端口;
重点是在 Advanced
中配置:
1 2 3 4 5 6 7 location / { proxy_pass https://nextcloud.evergardenviolet.top:8082; proxy_set_header Host $http_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_pass
的后端协议是 https
。
cron 定时任务配置
手动先执行是否有报错:
1 docker exec -u 33 Nextcloud-fpm-cron php -f /var/www/html/cron.php 2>&1 /dev/null
Nextcloud-fpm-cron
是 cron 镜像的名称。
如果没有报错就添加到 cron 定时任务:
1 2 vim /etc/crontab */5 * * * * root docker exec -u 33 Nextcloud-fpm-cron php -f /var/www/html/cron.php 2>&1 /dev/null
config.php 配置
位置在 config/config.php
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 <?php $CONFIG = array ( 'passwordsalt' => '5NcGa7vnB5xxxt8U+RNvfYg' , 'secret' => 'sdafeffas49wfqwf21qfq2fqfq5fqf5qf5' , 'trusted_domains' => array ( 0 => 'localhost' , 1 => 'nextcloud.domain.com' , ), 'datadirectory' => '/var/www/html/data' , 'dbtype' => 'mysql' , 'version' => '31.0.4.1' , 'overwrite.cli.url' => 'https://nextcloud.domain.com' , 'dbname' => 'nextcloud' , 'dbhost' => 'mysql' , 'dbport' => '' , 'dbtableprefix' => 'oc_' , 'mysql.utf8mb4' => true , 'dbuser' => 'nextcloud' , 'dbpassword' => 'mysql_pass' , 'installed' => true , 'instanceid' => 'oc0tmoeihstm' , 'memcache.local' => '\\OC\\Memcache\\APCu' , 'memcache.locking' => '\\OC\\Memcache\\Redis' , 'redis' => array ( 'host' => 'redis' , 'port' => 6379, 'timeout' => 0.0, 'read_timeout' => 0.0, 'user' => 'nextcloud' , 'password' => 'redis2025' , 'dbindex' => 0, ), 'overwriteprotocol' => 'https' , 'maintenance_window_start' => 1, 'default_timezone' => 'Asia/Shanghai' , 'default_phone_region' => 'CN' , 'logtimezone' => 'Asia/Shanghai' , 'maintenance' => false , );
不清楚项目参考官网文档:Table of contents — Nextcloud latest Administration Manual latest documentation
着重说明以下配置:
overwriteprotocol
如果 NPM 上做了强制 https,这里设置为 https
,不然会报警告
maintenance_window_start
维护时段,4h,解决警告。
default_phone_region
解决警告。
memcache.local
, memcache.locking
, redis.array
缓存配置,一是解决登录 303 循环,二是解决警告。
管理地址
https://nextcloud.domain.com
,
疑惑&问题
镜像选择
Q:为什么没有选择 AIO 或 apache 版本
A:单纯想折腾 喜欢,当然不可能这么随便。。简言之,Apache 版自带web,可以快速部署;AIO 整合服务,大而全,内存占用较高,fpm 比较折腾。。具体区别没有部署另两套也说不清,本质上没区别。
Q:为什么没有用nginx官方镜像,选择了 openresty
A:忘了具体啥原因,最开始用的是nginx 官方的镜像,但是遇到了问题所以换到了 openresty
关于 docker-compose.yml
Q:环境变量都是必需的吗?
A:不是。声明环境变量是为了跳过初始化安装步骤,如果不声明访问 Web 会要求初始化设置数据库、缓存等配置。
Q:volumes
挂载最末尾的 z
和 Z
什么意思?
A:这两个是SELinux 标签控制选项 ,主要用于解决容器与宿主机文件系统的权限兼容性问题。z
表示共享标签 ,允许多个容器读写同一卷中的文件(比如html静态资源); Z
表示私有标签 ,仅当前容器可读写,其他容器和宿主机进程无权限(比如数据库、密钥)。
Q:networks
external: "true"
为什么第一次要注释后执行?
A:external: "true"
表示将多个容器加入已存在网络便于通信,如果预先创建了使用自定义网络名就会报错,因此出此方法。
Q:为什么 MySQL 和 Redis 没有端口映射?
A:仅用于 Nextcloud 项目,不对外开放,仅内部网络可见。如果已有公共 MySql 和 Redis 可以使用外部的。
全链路 https
Q:为什么容器部署的 nginx 也要配置 https,外面都有一层 https 的 NPM 了,何必多此一举?
A:可能(未验证)是为了解决启用 External storage support
插件时报错“错误:该应用程序不能被启用 因为使服务器不稳定”的问题,具体在疑问部分详细说明。
专业性
Q:怎么感觉你这教程不太专业,小问题一堆啊?
A:呃呃呃,不反驳确实是这样。在磕磕碰碰部署完成把问题基本解决之后再统一梳理的教程,因此不可避免会存在很多小问题,已经不想再重新搞一次了,等后面啥时候换容器或者闲了再看看。
启用 External storage support 插件报错
该应用程序不能被启用 因为使服务器不稳定
打开 F12
可以看到控制台报错,http://nextcloud.domain.com because it violates the following Content Security Policy directive: "connect-src 'self' nextcloud
大概就是这个意思,至于为什么我们已经在 NPM 开启了强制 https 但这里还是出现了 http 的问题,可能是由于 NPM Advanced
中配置的 proxy_pass
后端协议不是 https
,另一个可能的原因是容器部署的 nginx 还是 80(现在感觉应该不太可能,但也不想验证了。。)。检查这两个地方基本就可以解决问题。
nextcloud.log 报错
NOPERM User nextcloud has no permissions to run the ‘select’ command
别样的 Deepseek ,问进去说是数据库的问题,死活找不到问题,直接 bing 了以下,是 Redis 没有 SELECT
权限,所以在加上了权限 +@connection
重启之后即可。
在线文档选择
onlyoffice 还是 libreoffice ,or nextcloud office?
根据 Deeoseek 的搜索结果,onlyoffice
侧重于多人协作、实时在线,分社区版和企业版;libreoffice
完全免费,功能性、数学公式、矢量图更有优势。二者均可。至于 nextcloud office,在性能表现、功能性上比另外两个差点(具体也没有测过)。
警告处理
在后台【管理】-【概览】-【安全与设置警告】,检查出现的告警。
登录循环303
现象:通过域名 https
访问登录,一直303循环无法登录
原因:连接 Redis 异常,结合 data/nextcloud.log
查看具体报错原因。可能报错原因:
Redis 容器地址端口错误:如果和上面 docker-compose.yml
一致使用 nextcloud
专用网络,可以使用容器服务名 redis
,端口为 6379
,即使此时存在其他使用该端口的 Redis 也是如此,相当于是个局域网,不冲突。
Redis 未配置 ACL 权限
Redis 配置中 supervised systemd
配置的值为 no
Redis 用户无权限执行 eval
等脚本:未按照 acl 添加 +@scripting
权限
添加后台任务
参考前面步骤
不安全 URL
你正通过安全连接访问你的实例,然而你的实例正生成不安全的 URL。这很可能意味着你位于反向代理的后面,覆盖的配置变量没有正确设置。
没有在 config.php
配置 trust_domains
和 overwriteprotocol
。
默认电话区域
参考资料:[ISO 3166-1_百度百科](https://baike.baidu.com/item/ISO 3166-1/5269555)
在 config/config.php
添加 default_phone_region
。
数据库索引丢失
数据库丢失了一些索引。由于给大的数据表添加索引会耗费一些时间,因此程序没有自动对其进行修复。您可以在 Nextcloud 运行时通过命令行手动执行 “occ db:add-missing-indices” 命令修复丢失的索引。索引修复后会大大提高相应表的查询速度
按照告警到 nextcloud 应用容器内部执行指令:
1 docker exec --user www-data nextcloud-aio-nextcloud php occ maintenance:repair --include-expensive
优化调整
挂载外部SMB存储
启用 【External storage support】;
更新仓库源:
因为容器内没有编辑器,所以选择了挂载:
1 /data/Containers/nextcloud/apt/debian.sources:/etc/apt/sources.list.d/debian.sources
更新为中科大镜像源:
1 2 3 4 5 6 7 8 9 10 11 Types: deb URIs: http://mirrors.ustc.edu.cn/debian Suites: bookworm bookworm-updates Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: http://mirrors.ustc.edu.cn/debian-security Suites: bookworm-security Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
在容器内安装 smb 扩展
GitHub - eduardok/libsmbclient-php: smbclient’s extension for PHP
1 2 3 4 5 apt-get install libsmbclient-dev pecl install smbclient
修改 php.ini
启用:
1 2 extension="smbclient.so"
重启容器生效。
唯一的问题是如果进行了更新需要再手动执行一遍,或许可以加到
更改默认窗口
默认的 Dashboard 窗口华而不实,可以修改 config 换成 file 界面。
在 config.php
中新增配置:
1 'defaultapp' => 'files' ,
这里的files
是app的名字,你可以通过ls $work/app/apps
查看,也可以在打开指定页面后在地址栏后面 apps/<NAME>
看到。
onlyoffice DocumentServer
在 Nextcloud 中集成 OnlyOffice 时,必须同时安装 OnlyOffice 插件 和独立的 Document Server :
OnlyOffice 插件:前端 UI,
Document Server:独立文档处理引擎,文档处理。可以使用 nextcloud 的插件或独立部署,这里选择了独立部署。
部署
创建数据目录
1 2 work=/data/Containers/onlyoffice mkdir $work /{logs,data}
创建容器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 services: onlyoffice-documentserver: container_name: Onlyoffice-DocumentServer image: onlyoffice/documentserver ports: - 8083:80 volumes: - /data/Containers/onlyoffice/logs:/var/log/onlyoffice - /data/Containers/onlyoffice/data:/var/www/onlyoffice/Data networks: - nextcloud restart: unless-stopped networks: nextcloud: driver: bridge name: nextcloud external: "true"
获取 token
启动后查看容器日志,会看到以下内容:
1 JWT is enabled by default. A random secret is generated automatically. Run the command "docker exec <container_id> sudo documentserver-jwt-status.sh" to get information about JWT.
执行获取 token。
nextcloud 集成
修改 onlyoffice Docs 地址为 NPM 配置的地址,密钥即为 JWT token,保存验证是否正常。