Good day!

Sorry for rather long letter, but this is the summary from numerous
discuissions and I really tried to make it short.

I happened to notice the wrong behaviour of the Apache proxying
modules (originally, mod_proxy, but later the mod_rewrite and
essentially, all clients of mod_proxy rewriting) when it is doing
reverse-proxying for a DAV server.

The setup is following: HTTPS server is used as the reverse proxy
(RP) and the DAV server is sitting on the localhost and using the
HTTP transport. The problem is that the 'Destination' header is not
rewritten by the RP server and the DAV server refuses to serve the
MOVE and COPY requests. The problem is rather well understood:
        http://silmor.de/49
        http://svn.haxx.se/users/archive-2003-08/0763.shtml
        http://svn.haxx.se/users/archive-2006-03/0549.shtml
and there are some workarounds for it ranging from the manual
patching the Apache mod_dav sources to get rid from the schema and
port checking (modules/dav/main/util.c:204 from the snapshot
httpd_20070330041747.tar.gz) to using the header rewriting routines
appeared (but not yet documented) in the 2.2.4.

My thought is that modules that are doing the rewriting stuff (in
the reverse proxy mode) should care for the 'Destination' header
themselves. So, I wrote the patch for the mod_proxy and, later, for
the mod_rewrite:
        http://issues.apache.org/bugzilla/show_bug.cgi?id=41698

But Ruediger Pluem was kindly pointed that all modules that are
using the mod_proxy rewriting routines should be fixed by the patch.
I am not sure that it can be done in the generic case, because
mod_proxy currently have no idea about the other modules rewriting
procedures, it is just passed the 'proxy:whatever' URL.  Please,
see the bug's comments for the complete discuission. (Comments 13-16
are the most relevant to my and Ruediger's points of view).

There are at least three solutions:
- patch the Apache's own modules to rewrite 'Destination' header
  and leave other third-party modules patching to their respective
  authors.
- invent the generic way to rewrite the 'Destination' header (and
  others) in the mod_proxy.
- leave the things 'as is' and make the notes in the mod_rewrite
  and mod_proxy documentation about the DAV and header rewriting,
  saying that header rewriting will help.

I am somewhat against the third case, because my mind tells me that
if programmers can do something with this problem, they should try.

Can anyone comment on this topic?

Thanks for your patience! ;))

PS: talking about the latest patch version. I am not entirely sure
that the 'dirpath' argument in the mod_rewrite part is getting the
right value. The intent was to has the directory prefix for the
current location. I will research into is a bit later, but may be
someone will enlight me with the knowledge on how to get the correct
value of 'dirpath'?
-- 
Eygene

Reply via email to