反向代理后面的 WebDAV
我有 2 台服务器。 一个反向代理位于网络上,另一个位于服务 WebDAV 的专用链接上。
Booth 服务器是 apache httpd v2。
在代理上我有:
ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /repo/ http : //share.local/repo/ ProxyPassReverse /repo/ http : //share.local/repo/
在 dav 服务器上我有:
<Location /repo/> DAV on Order allow,deny allow from all </Location>
反向代理通过 https
访问,私有服务器通过 http
访问。 问题就在这里!
只读命令工作正常。 但是当我想移动某些东西时,我得到了502 Bad gateway
。 原因是反向代理没有重写扩展 dav 请求中的 url。
源 URL 位于标头内,并正确转换为 http://share.local/file1
。 目标 URL 位于一些我不理解的 xml 片段中,并保留为 https://example.com/file1
:(
有没有一种标准方法可以让 apache 正确转换请求?
感谢您的努力。
I have 2 servers. One Reverse proxy on the web and one on a private link serving WebDAV.
Booth servers are apache httpd v2.
On the proxy I have:
ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /repo/ http : //share.local/repo/ ProxyPassReverse /repo/ http : //share.local/repo/
On the dav server I have:
<Location /repo/> DAV on Order allow,deny allow from all </Location>
The reverse proxy is accessed via https
and the private server is accessed via http
.
And there lies the problem!
Read only commands work fine. But when I want to move something I get 502 Bad gateway
.
The reason for this is the reverse proxy not rewriting the url's inside the extended dav request.
The source URL is inside the header and is correctly transformed to http://share.local/file1
.
The destination URL is inside some xml fragment I do not understand and stays https://example.com/file1
:(
Is there a standard way to let the apache correctly transform the request?
Thanks for your effort.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,找到答案了。 总是一样的:)
我将下一行添加到我的“私人服务器”配置文件中:(
例如配置位置“/etc/httpd/conf.d/DefaultRequestHeader.conf”)
并且它起作用了。 我不知道这是否有缺点。 我会明白的。
Hmm, found the answer. Always the same :)
I added the next line to my 'private server' config file:
(e.g. of config location '/etc/httpd/conf.d/DefaultRequestHeader.conf')
and it worked. I don't know if this has drawbacks. I'll see.
正如您已经注意到的那样,目标 URL 不应位于 XML 中,而应位于“Destination”标头中。 也许您正在查看错误响应...
一般来说,当客户端和服务器实现 WebDAV 级别 3(如 RFC4918 中定义)时,这个问题就会消失,该级别允许目标标头只是相对路径。
The destination URL shouldn't be in XML but in the "Destination" header, as you already noticed. Maybe you were looking at the error response...
In general, this problem would go away when clients and servers implement WebDAV level 3 (as defined in RFC4918), which allows the Destination header to be just a relative path.