加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

apache-2.2 – 在NginX后面的Apache mod_dav安装上,WebDav重命

发布时间:2020-12-13 21:19:27 所属栏目:Nginx 来源:网络整理
导读:我正在尝试通过WebDav重命名文件来解决问题.我们的堆栈由一台机器组成,通过Nginx,Varnish和Apache提供内容.当您尝试重命名文件时,操作将失败,并显示我们当前正在使用的堆栈. 要连接到WebDav,客户端程序必须: 通过https://host:443连接到NginX NginX在http:/

我正在尝试通过WebDav重命名文件来解决问题.我们的堆栈由一台机器组成,通过Nginx,Varnish和Apache提供内容.当您尝试重命名文件时,操作将失败,并显示我们当前正在使用的堆栈.

要连接到WebDav,客户端程序必须:

>通过https://host:443连接到NginX
> NginX在http://localhost:81处将请求解包并转发给Varnish服务器
> Varnish在http://localhost:82将请求转发给Apache,后者通过mod_dav提供会话

以下是重命名失败的示例:

$cadaver https://webdav.domain/
Authentication required for Webdav on server `webdav.domain':
Username: user
Password:

dav:/> cd sandbox
dav:/sandbox/> mkdir test
Creating `test': succeeded.

dav:/sandbox/> ls
Listing collection `/sandbox/': succeeded.
Coll:   test                                   0  Mar 12 16:00

dav:/sandbox/> move test newtest
Moving `/sandbox/test' to `/sandbox/newtest':  redirect to http://webdav.domain/sandbox/test/

dav:/sandbox/> ls
Listing collection `/sandbox/': succeeded.
Coll:   test                                   0  Mar 12 16:00

有关更多反馈,WebDrive Windows客户端在重命名操作上记录了错误502(错误网关)和303(?).扩展日志提供了以下信息:

Destination URI refers to different
scheme or port (07003)
(want: 07004).

其他一些限制:调查NginX的Webdav模块表明它并不真正符合我们的需求,并且将webdav流量转发到Apache不是一种选择,因为我们不想启用Apache SSL.

有没有办法欺骗mod_dav转发到另一个主机?我很开心:).

最佳答案
(回到我使用Subversion的日子)我从Nginx SSL前端代理到Apache SVN时遇到了类似的问题.假设Nginx SSL前端是https:// host,我们想代理到内部Apache SVN服务器的连接http:// svn

当您尝试使用Destination标头复制资源时,会发生此问题:

COPY /path HTTP/1.1
Host: host
Destination: https://host/another_path

如您所见,Destination标头仍包含https架构.修复非常明显 –

location / {
    # to avoid 502 Bad Gateway:
    # http://vanderwijk.info/Members/ivo/articles/ComplexSVNSetupFix
    set $destination $http_destination;

    if ($destination ~* ^https(.+)$) {
         set $destination http$1;
    }

    proxy_set_header Destination $destination;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;

    proxy_pass http://svn;
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读