到目前为止,我只是使用
location /drive/ { # wsgidav
proxy_pass http://127.0.0.1:8080/;
}而且它似乎起了作用。我可以把文件放到服务器,获取它们,浏览目录等,所有从Windows资源管理器。但是,我不能在服务器上重命名文件。当我尝试时,我得到502坏网关
14:57:44.803 - INFO : 127.0.0.1 - (anonymous) - [2022-10-14 12:57:44] "MOVE /user/Downloads/Text.txt" dest="https://myserver.com/drive/user/Downloads/Text1.txt", length=0, depth=0, overwrite=F, elap=0.001sec -> 502 Bad Gateway我在配置中遗漏了什么吗?Thx
发布于 2022-10-15 14:45:13
因为噪音,我自己找到了一个。如果其他人发现有用的话就把这个留在这里。
关于文件不能在反向代理后面重命名的问题,存在一个封闭的问题。一种解决方案建议“配置反向代理,将目标标头的协议从”https:“重写到”http:“。
我遵循这个建议,在config的服务器部分之外添加了一个映射规则
map $http_destination $driveDestination { # otherwise MOVE results in a 502 Bad Gateway
default $http_destination;
"~*^https://myserver.com/drive/(.+)" /$1;
}以及webdav驱动器的以下位置
## Begin - wsgidav
location /drive/ { # trailing slash means it will be added
proxy_pass http://127.0.0.1:8080/; # - trailing slash means location will be dropped
# https://github.com/mar10/wsgidav/issues/183
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_buffering off;
client_max_body_size 0;
proxy_request_buffering off;
proxy_set_header Destination $driveDestination; # result of map command above
}
## End - wsgidav唉,它起作用了。
https://stackoverflow.com/questions/74069820
复制相似问题