Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webDAV 根据您提供的https方案似乎没有效果 #90

Closed
Xiaoph123 opened this issue May 11, 2024 · 11 comments
Closed

webDAV 根据您提供的https方案似乎没有效果 #90

Xiaoph123 opened this issue May 11, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Xiaoph123
Copy link

Xiaoph123 commented May 11, 2024

我使用的是win11,已关闭windows的防火墙

服务器使用centos7,docker部署方案

这是我的nginx配置:

server {
    #网盘7000地址
    listen 9000 ssl;
    server_name xxxxxxx;  # 修改为你的域名或服务器 IP 地址
    # 证书配置
     ssl_certificate /www/server/nginx/xxxxxx_bundle.crt;
     ssl_certificate_key /www/server/nginx/xxxxxx.xkey;

    location / {
        #proxy_set_header Host $host; 
        proxy_pass http://localhost:7070;  # 网盘地址
        #webdav追加
        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-Port $server_port;
        proxy_set_header REMOTE-HOST $remote_addr; 
        proxy_set_header Upgrade $http_upgrade; 
        proxy_set_header Connection "upgrade"; 
        proxy_set_header X-Forwarded-Proto $scheme; 
        proxy_http_version 1.1; 
        add_header X-Cache $upstream_cache_status; 
        add_header Strict-Transport-Security "max-age=31536000"; 
        add_header Cache-Control no-cache; 
        add_header 'Access-Control-Allow-Origin' '*'; 
    }
}


server {
    # #网盘7072地址
    listen 9001 ssl;
    server_name xxxxxx;  # 修改为你的域名或服务器 IP 地址
    # 证书配置
     ssl_certificate /www/server/nginx/xxxxxx_bundle.crt;
     ssl_certificate_key /www/server/nginx/xxxxxx.key;

    location / {
        proxy_pass http://localhost:7072/public/api;  #网盘API地址
        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;
        add_header 'Access-Control-Allow-Origin' '*'; 
    }
    location /webDAV/ {
        proxy_pass   http://localhost:7072/webDAV/;
        proxy_set_header Host $http_host;
        proxy_set_header Scheme $scheme;
        proxy_set_header X-Real-IP $remote_addr; 
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header Upgrade $http_upgrade; 
        proxy_set_header Connection "upgrade"; 
        proxy_set_header X-Forwarded-Proto $scheme; 
        proxy_http_version 1.1; 
        add_header 'Access-Control-Allow-Origin' '*';
}

}

并且我直接复制粘贴您给的docker-compose.yml配置

这是原来的docker-compose.yml配置:

version: "3"
services:
  mongo:
    container_name: ${CONTAINER_NAME_PREFIX}_mongodb
    image: mongo:4.4
    environment:
      TZ: Asia/Shanghai
    ports:
      - 27018:27017
    volumes:
      - ${RESOURCE_DB_PATH}/data/db:/data/db
      - ${RESOURCE_DB_PATH}/custom:/etc/mongo
      - ${RESOURCE_DB_PATH}/backup:/dump
    restart: unless-stopped
    command: --wiredTigerCacheSizeGB 0.5
  jmalcloud:
    container_name: ${CONTAINER_NAME_PREFIX}_server
    image: jmal/jmalcloud:latest
    environment:
      MONGODB_URI: mongodb://mongo:27017/jmalcloud
      TZ: Asia/Shanghai
    ports:
      - ${SERVER_PORT}:8088
      - ${FTP_SERVER_PORT}:8089
    volumes:
      - ${RESOURCE_FILE_PATH}:/jmalcloud/files/
    restart: always
  nginx:
    container_name: ${CONTAINER_NAME_PREFIX}_nginx
    image: jmal/jmalcloud-nginx:latest
    ports:
      - ${APP_PORT}:80
      - ${BLOG_PORT}:8089
    environment:
      TZ: Asia/Shanghai
    links:
      - jmalcloud
      - office
      - drawio-webapp
    restart: always
  office:
    container_name: ${CONTAINER_NAME_PREFIX}_office
    image: onlyoffice/documentserver:${OFFICE_IMAGE_VERSION}
    environment:
      TZ: Asia/Shanghai
    restart: always
  drawio-webapp:
    container_name: ${CONTAINER_NAME_PREFIX}_drawio
    image: jgraph/drawio:${DRAWIO_IMAGE_VERSION}
    environment:
      TZ: Asia/Shanghai
    restart: always
networks: {}

现docker-compose.yml配置:

version: "3"
services:
  jmalcloud:
    container_name: jmalcloud_server
    image: jmal/jmalcloud:latest
    environment:
      MONGODB_URI: mongodb://mongo:27017/jmalcloud
      TZ: Asia/Shanghai
    volumes:
      - ./docker/jmalcloud/files:/jmalcloud/files/
    ports:
      - 7072:8088
    restart: unless-stopped
  mongo:
    container_name: jmalcloud_mongodb
    image: mongo:4.4
    environment:
      TZ: Asia/Shanghai
    volumes:
      - ./docker/jmalcloud/mongodb/data/db:/data/db
    restart: unless-stopped
    command: --wiredTigerCacheSizeGB 0.5
  nginx:
    container_name: jmalcloud_nginx
    image: jmal/jmalcloud-nginx:latest
    ports:
      - 7070:80
      - 7071:8089
    environment:
      TZ: Asia/Shanghai
    links:
      - jmalcloud
      - office
      - drawio-webapp
    restart: unless-stopped
  office: # Optional
    container_name: jmalcloud_office
    image: onlyoffice/documentserver:7.0.0.132
    environment:
      TZ: Asia/Shanghai
    restart: unless-stopped
  drawio-webapp: # Optional
    container_name: jmalcloud_drawio
    image: jgraph/drawio:20.2.3
    environment:
      TZ: Asia/Shanghai
    restart: unless-stopped

更改yml文件并重启网盘,挂在到windows11上还是无法使用webDAV,

重命名提示报错信息:

mmexport1715429176140.png

上传文件时:

mmexport1715429178817.png

上传文件夹时只能上传文件夹,不能上传文件夹内的文件

从网盘中复制粘贴文件夹时倒是可以粘贴过来,但是里面的文件无法正常打开

请您帮忙看下,我的配置是否有问题

@jamebal
Copy link
Owner

jamebal commented May 11, 2024

windows上确实有这个问题

@jamebal jamebal added the bug Something isn't working label May 11, 2024
@jamebal
Copy link
Owner

jamebal commented May 11, 2024

你更新下镜像再试试

@Xiaoph123
Copy link
Author

Xiaoph123 commented May 11, 2024

你更新下镜像再试试

更新镜像后,从云盘复制文件夹到桌面,里面的文件正常了,但是重命名,上传文件和上传文件夹依然不行。
打开office文件时提示报错,只能阅读不能编辑
mmexport1715446335425.png

在网页上登录webdav地址:
登录前:
mmexport1715447909668.png

登录后:
IMG_20240512_012026.png

@jamebal
Copy link
Owner

jamebal commented May 12, 2024

不用https,直接使用这个地址呢:http://IP:7072/webDAV/用户名,看是https的问题还是webdav服务的问题

@jamebal
Copy link
Owner

jamebal commented May 12, 2024

如果不使用https正常, 那么https的nginx配置需要加上这一行:
proxy_set_header X-Forwarded-Port $server_port;

location /webDAV/ {
    proxy_pass   http://192.168.0.192:7072/webDAV/;
    proxy_set_header Host $http_host;
    proxy_set_header Scheme $scheme;
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Port $server_port; # https使用非443端口需要加上这一个行
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection "upgrade"; 
    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_http_version 1.1; 
}

@Xiaoph123
Copy link
Author

不用https,直接使用这个地址呢:http://IP:7072/webDAV/用户名,看是https的问题还是webdav服务的问题

我测试一下

@Xiaoph123
Copy link
Author

Xiaoph123 commented May 12, 2024

不用https,直接使用这个地址呢:http://IP:7072/webDAV/用户名,看是https的问题还是webdav服务的问题

我在Linux浏览器中跑本地的jmalcloud项目http://localhost:7072/webDAV/用户名
登录之后报错
mmexport1715479696592.png

本地项目出现了问题

@jamebal
Copy link
Owner

jamebal commented May 13, 2024

v2.8.2修复了该问题, 并且nginx也不需要额外的配置了

@Xiaoph123
Copy link
Author

v2.8.2修复了该问题, 并且nginx也不需要额外的配置了

好的,晚会儿测试下

@Xiaoph123
Copy link
Author

v2.8.2修复了该问题, 并且nginx也不需要额外的配置了

2.8.2中上传文件与修改office文件还是有之前的问题,其他功能已修复

@Xiaoph123
Copy link
Author

Xiaoph123 commented May 13, 2024

v2.8.2修复了该问题, 并且nginx也不需要额外的配置了

在测试中我发现当我使用下面的yml文件时,在网页端上传office文件或者压缩包会出现报错提示:

version: "3"
services:
  jmalcloud:
    container_name: jmalcloud_server
    image: jmal/jmalcloud:latest
    environment:
      MONGODB_URI: mongodb://mongo:27017/jmalcloud
      TZ: Asia/Shanghai
    volumes:
      - ./docker/jmalcloud/files:/jmalcloud/files/
    restart: unless-stopped
  mongo:
    container_name: jmalcloud_mongodb
    image: mongo:4.4
    environment:
      TZ: Asia/Shanghai
    volumes:
      - ./docker/jmalcloud/mongodb/data/db:/data/db
    restart: unless-stopped
    command: --wiredTigerCacheSizeGB 0.5
  nginx:
    container_name: jmalcloud_nginx
    image: jmal/jmalcloud-nginx:latest
    ports:
      - 7070:80
      - 7071:8089
    environment:
      TZ: Asia/Shanghai
    links:
      - jmalcloud
      - office
      - drawio-webapp
    restart: unless-stopped
  office: # Optional
    container_name: jmalcloud_office
    image: onlyoffice/documentserver:7.0.0.132
    environment:
      TZ: Asia/Shanghai
    restart: unless-stopped
  drawio-webapp: # Optional
    container_name: jmalcloud_drawio
    image: jgraph/drawio:20.2.3
    environment:
      TZ: Asia/Shanghai
    restart: unless-stopped

虽然报错但是能上传上去,下面是上传压缩包时得报错
mmexport1715613806487.png
压缩包有时则是上传不成功。

office第一次上传报了个错,但是后面再次上传就没有报错不太好复现,没能截下报错图。
其他文件上传尚未测试

jamebal added a commit to jamebal/jmal-cloud-server that referenced this issue May 17, 2024
@jamebal jamebal closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants