同一台服务器部署Seadoc后,seafile首页显示Welcome to sdoc-server. The current version is 2.0.9

请按照以下模版详细描述您遇到的问题:

当前服务器版本

Seafile 13 社区版

部署/操作过程(请说明二进制部署/docker部署;出现错误的操作步骤)

Docker Compose部署

错误截图

首页显示 Welcome to sdoc-server. The current version is 2.0.9

错误日志

浏览器控制台错误信息(如果相关,请提供截图信息)

Seadoc.yml 配置如下:

services:

seadoc:

image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:2.0-latest}

container_name: seadoc

restart: unless-stopped

volumes:

  - ${SEADOC_VOLUME:-/opt/seadoc-data/}:/shared

environment:

  - DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db4isle}

  - DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}

  - DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}

  - DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}

  - DB_NAME=${SEADOC_MYSQL_DB_NAME:-${SEAFILE_MYSQL_DB_SEAHUB_DB_NAME:-seahub_db}}

  - TIME_ZONE=${TIME_ZONE:-Etc/UTC}

  - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}

  - NON_ROOT=${NON_ROOT:-false}

  - SEAHUB_SERVICE_URL=${SEAHUB_SERVICE_URL:-https://xxx.xxxxx.com}

depends_on:

  db4isle:

    condition: service_healthy

networks:

  - webnet

networks:

webnet:

external: true

.env文件配置如下:

#################################

# Docker compose configurations #

#################################

COMPOSE_FILE=‘seafile-server.yml,seadoc.yml’

COMPOSE_PATH_SEPARATOR=‘,’

## Images

SEAFILE_IMAGE=seafileltd/seafile-mc:13.0.25

SEAFILE_DB_IMAGE=cowade/maria1011:latest

SEAFILE_REDIS_IMAGE=redis

SEADOC_IMAGE=seafileltd/sdoc-server:2.0-latest

NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:13.0-latest

MD_IMAGE=seafileltd/seafile-md-server:13.0-latest

## Persistent Storage

BASIC_STORAGE_PATH=/mnt/dk/xxxx

SEAFILE_VOLUME=$BASIC_STORAGE_PATH/seafile-data

SEAFILE_MYSQL_VOLUME=$BASIC_STORAGE_PATH/seafile-mysql/db

SEADOC_VOLUME=$BASIC_STORAGE_PATH/seadoc-data

#################################

# Startup parameters #

#################################

SEAFILE_SERVER_HOSTNAME=xxx.xxxxx.com

SEAFILE_SERVER_PROTOCOL=https

TIME_ZONE=Asia/Shanghai

JWT_PRIVATE_KEY=9fd91824a2e0b8d9e3d0d5dkenslxxxx

#####################################

# Third-party service configuration #

#####################################

## Database

SEAFILE_MYSQL_DB_HOST=db4isle

SEAFILE_MYSQL_DB_USER=seafile

SEAFILE_MYSQL_DB_PASSWORD=xxxxxx

SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db

SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db

SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db

## Cache

CACHE_PROVIDER=redis # or memcached

### Redis

REDIS_HOST=redis4isle

REDIS_PORT=6379

REDIS_PASSWORD=

### Memcached

MEMCACHED_HOST=memcached

MEMCACHED_PORT=11211

######################################

# Initial variables #

# (Only valid in first-time startup) #

######################################

## Database root password, Used to create Seafile users

INIT_SEAFILE_MYSQL_ROOT_PASSWORD=xxxxxxx

## Seafile admin user

INIT_SEAFILE_ADMIN_EMAIL=xxxx@xxxxx.com

INIT_SEAFILE_ADMIN_PASSWORD=xxxxxxxxxxxxxx

############################################

# Additional configurations for extensions #

############################################

## SeaDoc service

ENABLE_SEADOC=true

SEADOC_SERVER_URL=https://xxxx.xxxxxxx.com/sdoc-server

## Notification

ENABLE_NOTIFICATION_SERVER=false

NOTIFICATION_SERVER_URL=

## Seafile AI

ENABLE_SEAFILE_AI=false

ENABLE_FACE_RECOGNITION=false

SEAFILE_AI_LLM_TYPE=openai

SEAFILE_AI_LLM_URL=

SEAFILE_AI_LLM_KEY= # your llm key

SEAFILE_AI_LLM_MODEL=gpt-4o-mini

Metadata server

MD_FILE_COUNT_LIMIT=100000

万望高手帮忙瞅瞅问题出在哪。

PS:Nginx配置文件如下:

# ? HTTP ? HTTPS

server {

listen 80;

listen \[::\]:80;

server_name xxx.xxxxxx.com;     



return 301 https://$server_name$request_uri;

}

# HTTPS

server {

listen 443 ssl;

listen \[::\]:443 ssl;

http2 on;

server_name xxx.xxxxxx.com;  



\# ============ SSL ?       ============

####SSL配置省略

client_max_body_size 0;          

client_body_timeout 600s;       

proxy_read_timeout 600s;        

#为Docker容器设置的,配合下面location的set防止找不到服务而启动不了。

resolver 127.0.0.11 valid=10s ipv6=off;

location / {

proxy_pass http://sf4isle:80;

proxy_read_timeout 310s;

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 Connection "";

proxy_http_version 1.1;

client_max_body_size 0;

}

location /seafdav {

rewrite ^/seafdav$ /seafdav/ permanent;

}

location /seafdav/ {

proxy_pass         http://sf4isle:8080/seafdav/;

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-Host $server_name;

proxy_set_header   X-Forwarded-Proto $scheme;

proxy_read_timeout  1200s;

client_max_body_size 0;

\# access_log      /var/log/nginx/seafdav.access.log seafileformat;

\# error_log       /var/log/nginx/seafdav.error.log;

}

location /:dir_browser {

proxy_pass         http://sf4isle:8080/:dir_browser;

}

# SeaDoc

location /sdoc-server/ {

    proxy_pass         http://seadoc:80;

    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-Host  $server_name;

    proxy_set_header   X-Forwarded-Proto $scheme;

   client_max_body_size 100m;

}

location /socket.io {

    proxy_pass http://seadoc:80;

    proxy_http_version 1.1;

    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection 'upgrade';

    proxy_redirect off;

    proxy_buffers 8 32k;

    proxy_buffer_size 64k;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Host $http_host;

    proxy_set_header X-NginX-Proxy true;

}

\# location /media {

\#     root /opt/seafile/seafile-server-latest/seahub;

\# }

}

之前服务器一切正常,就是新建一个.sdoc文件打开时提示加载文档内容出错(类似这样的提示,红色的),所以想着安装seadoc,结果装好,主页就变成标题说的那样了。。。

关于访问根路径转发到sdoc的问题,您需要检查一下nginx的生效配置中有无根路径转发到sdoc容器的配置,如果是本机二进制部署可以使用下面的命令,docker则进入nginx容器内部执行:
nginx -T | grep -nE 'server_name|proxy_pass|listen'

查看是否输出类似下面的:

location / {

    proxy_pass http://seadoc:80;

   ······

}

如果有请仔细检查所有的nginx配置文件并删除类似的配置,只保留转发到seafile容器的配置:

location / {

    proxy_pass http://sf4isle:80;

   ······

}

除此之外请您修改nginx中的这一处配置

# SeaDoc

location /sdoc-server/ {

    proxy_pass         http://seadoc:80;

    ······

}

其中:

    proxy_pass         http://seadoc:80;

修改为

    proxy_pass         http://seadoc:80/;

两者行为不同:

  • proxy_pass http://seadoc:80;
    会把原 URI 继续传给 SeaDoc,例如 /sdoc-server/... 仍以该路径传递;
  • proxy_pass http://seadoc:80/;
    会去除匹配到的 /sdoc-server/ 前缀,把请求转为 SeaDoc 容器内的 /...。这才符合 SeaDoc 的部署方式。

详细可以见文档:

https://manual.seafile.com/latest/setup/use_other_reverse_proxy/#add-reverse-proxy-for-related-services


推荐您使用官网文档进行标准化部署,使用caddy作为反代,而不是分别拉取单独的容器

https://cloud.seafile.com/wiki/publish/seafile-manual/hk5G/

在下载官方的.env和yml文件后,修改.env中的BASIC_STORAGE_PATH=为您的路径/mnt/dk/xxxx可以无损升级,数据不会丢失;除此之外还需要修改ssl配置等
直接使用docker compose命令重新up容器即可

把proxy_pass 改为 http://seadoc:80/; 后,首页恢复了,访问xxx.com/sdoc-server 才会出现Welcome to sdoc-server. The current version is 2.0.9,这说明seadoc容器已经能正常反代了吗?

怎样确认seadoc已经可以正常使用了?

新建一个sdoc文件,可以正常打开并编辑,即正常

全新安装之后,问题就解决了。新问题又来了,在加密的资料库中无法编辑,新建和查看.sdoc文件。。。

加密资料库不支持sdoc新建、编辑和查看