views:

1261

answers:

2

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 stayes https : //example.com/file1 :(

Is there a standard way to let the apache correctly transform the request?

Thanks for your effort.

+3  A: 

Hmm, found the answer. Always the same :)

I added:

LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so

RequestHeader edit Destination ^https http early

and it worked. I don't know if this has drawbacks. I'll see.

Sounds good. Maybe that should be the default config then.
Julian Reschke
A: 

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.

Julian Reschke