[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: COPY causes 502 Bad Gateway through reverse proxy

From: Seth Daniel <subversion_at_sethdaniel.org>
Date: 2005-04-04 22:09:59 CEST

On Thu, Mar 31, 2005 at 01:48:40PM +0100, Dick Davies wrote:
> * Seth Daniel <subversion@sethdaniel.org> [0329 00:29]:
> > Hello,
> >
> > I have a setup where my subversion repository is hosted on a
> > local/private network and if someone is *outside* this network they can
> > make requests to the public reverse proxy.
> >
> > Both servers (subversion server and reverse proxy) are apache 2.0.53.
> > Connections to the reverse proxy are https. The connection to the
> > internal subversion server is regular http. Authentication is basic
> > auth and is handled by the internal subversion server.
>
> That's your problem, I think.

[...snip...]

Like I replied earlier, you were exactly correct:
  http://svn.haxx.se/users/archive-2005-03/1460.shtml

You had a patch that you applied to Apache
  http://svn.haxx.se/users/archive-2005-03/1452.shtml
  
I went ahead and wrote a very simple mod_perl2 handler that does much
the same thing. It simply changes the scheme of the Destination header
from https to http. For anyone who is interested here it is:

package ProxyDav;

use strict;

use Apache::RequestRec ();
use APR::Table ();
use URI;

use Apache::Const -compile => qw(OK);

sub handler {
        my $r = shift;

  my $method = $r->method();
        if ($method eq 'MOVE' || $method eq 'COPY') {
          my $destination = $r->headers_in()->get('Destination');
                my $new_destination = URI->new($destination);
                $new_destination->scheme('http');
                $r->headers_in()->set('Destination', $new_destination);
        }
  return Apache::OK;
}

1;

__END__

<Location /svn>
  SetHandler perl-script
  PerlHeaderParserHandler ProxyDav
</Location>
  

-- 
seth / @sethdaniel.org
The world really isn't any worse.  It's just that the news coverage
is so much better.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 4 22:12:32 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.