[thelist] proxy directives

John DeStefano john.destefano at gmail.com
Fri Oct 27 12:52:26 CDT 2006


On 10/23/06, John DeStefano <john.destefano at gmail.com> wrote:
> > From: "Anthony Baratta" <anthony at baratta.com>
> > To: thelist at lists.evolt.org <thelist at lists.evolt.org>, thelist at lists.evolt.org
> > Date: Mon, 23 Oct 2006 09:25:06 -0700
> > Subject: Re: [thelist] proxy directives
> > Why do you want to do this? Seems like  recipe for confusion. Sounds like these are two separate servers. So you are going to have to cross mount the file systems?? Or am I not reading your setup correctly?
>
> I don't wish to cross-mount.  This may be too much information for
> this problem, but I am currently serving two directories on one
> machine, one authenticated (HTTPS) and one not (HTTP). Further, the
> authenticated directory contains dynamic content generated by scripts,
> and the unauthetnicated pages are crawled, HTML-only versions of the
> dynamic content.  Finally, although the actual content between the two
> is essentially the same, the sub-directory structure isn't, due to the
> results of the crawler versus the much more flat nature of the
> scripted content.
>
> So, what I want to do is:
> - Proxy both the HTTP and HTTPS content from another server, so that
> the server host name will not appear to be different, save for the "S"
> in "HTTPS" (I've already got this working, albeit probably not the
> right way)
> - Create a "virtual" directory structure that mirrors one server
> instance for the other, even though that directory does not actually
> exist in the other (see below).  In essence, I need the URL space for
> the server instances to match (except for "HTTP:" versus "HTTPS:").
>
> Eventually, I will move the HTTP stuff to a separate server so the
> HTTPS stuff will be a bit more secure, and that will alleviate some
> (but not all) of these issues.
>
> > > Any apache proxy|rewrite|alias gurus out there?
> > >
> > > Let's say I have a directory on Server A called /var/www/directory.  I
> > > would like all web requests to be proxied by another server, Server B.
> > >  I would like any requests that call for http://serverb/dir/ect/ory/
> > > to be served by /var/www/directory on Server A, but I would like the
> > > URL to maintain the path shown by Server B (for example:
> > > /var/www/directory/file1 on Server A could be viewed at
> > > http://serverb/dir/ect/ory/file1 ).
> > >
> > > What would be the best apache directive and approach to accomplish this?
> > >
> > > Also, if you can recommend a good book that might help demystify all
> > > this, I'd really appreciate it.  The apache online docs are clear and
> > > very thorough, especially when you know exactly what you're looking
> > > for, but I'm finding myself going in circles on this one.
> > >
>

I've been trying to work this out, but I seem to come up with nothing
better than partial solutions.

I think a very simple pair of ProxyPass|ProxyPassReverse directives
could replace some of this stuff, but not all... something like this
on the proxy server:

ProxyPass /dir/ect/ory http://server/directory
ProxyPassReverse /dir/ect/ory http://server/directory

That seems to do exactly what I need as far as the client-side URL goes.

The problem is the subdirs: I'm doing this because I need to mirror
TWiki pages (which are not .HTML files) with their HTML counterparts.
The TWiki treats URL space a bit differently (their "webs" and
"topics" appear as directories without a trailing slash in the URL).
So when you browse to a specific page of the TWiki, you don't append
.html to the URL because it doesn't exist. However, it's there on the
HTML mirror, and I need something to not ony append the .html suffix
to each incoming request, but to be able to tell whether the request
is looking for a file or a directory.

This RewriteRule seems to work for that:
RewriteRule  ^/dir/ect/ory/$ http://server/directory/ [R]

... if I duplicate it so it appears with and without the trailing
slash, and for each subdirectory (I'm sure there's a better way... I
can't figure out the syntax to condense it all). But that doesn't help
with the URL space issue that ProxyPass seems to help with.



More information about the thelist mailing list