RECENT ENTRIES
This is a duplication of a blog post I made in 2005 on a different blog.
When receiving an error like 502 Bad Gateway from Apache.
A small mod_perl2 module I wrote to fix a problem when proxying a Subversion server. Specifically, if you have a Subversion server on a private/local network and a reverse proxy on a public network, and a user connects to the reverse proxy via HTTPS and the reverse proxy connects to the Subversion server via HTTP. This causes problems with the COPY and MOVE HTTP methods. This is because mod_dav sends a Destination header with the wrong scheme. Your reverse proxy will not rewrite the path scheme properly (i.e. it will not change HTTPS to HTTP). The following code rewrites the scheme properly.
Here is the mailing list thread that started it all.
The code is named ProxyDav.pm and is valid for any mod_perl2 installation with a version greater than 1.999022.
The Apache configuration is simple:
<Location /svn>
SetHandler perl-script
PerlHeaderParserHandler ProxyDav
</Location>
The ProxyDav.pm file should be located somewhere in your Perl's @INC. You can
use perl -V to view the contents of @INC.
OTHER SITES