[sclug] Mod_proxy problems
Mayuresh Kadu
mskadu at gmail.com
Wed Jun 13 12:27:26 UTC 2007
Hi,
Hmm, you may have a point there. See below:
Source: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect
Extract:
>>
>> The Redirect directive maps an old URL into a new one by asking the
client to refetch the resource at the new location.
>> Example: Redirect /service http://foo2.bar.com/service
>>
Source: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirectmatch
Extract:
>> This directive is equivalent to Redirect, but makes use of standard
regular expressions, instead
>> of simple prefix matching. The supplied regular expression is matched
against the URL-path,
>> and if it matches, the server will substitute any parenthesized matches
into the given string and
>> use it as a filename. For example, to redirect all GIF files to
like-named JPEG files on another server,
>> one might use: RedirectMatch (.*)\.gif$
http://www.anotherserver.com$1.jpg
>>
I do realize both of above use HTTP 301/302/303/410 redirects. So, I suppose
mod_rewrite would be a better option? Useful link:
Apache 2 URL Rewrite Guide
http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html
regards,
- Mayuresh
On 6/13/07, Peter Brewer <pwb48 at cornell.edu> wrote:
>
> I thought ALIAS only worked on the same server. I didn't think you could
> use
> it to pass requests received on one server to another one on the local
> network?
>
> Peter
>
> On Wednesday 13 June 2007 12:18, Mayuresh Kadu wrote:
> > Umm. I haven't worked with mod_proxy before. But how is this different
> from
> > using ALIAS (aka mod_alias)? Have you considered that?
> >
> > Extracts from apache docs:
> >
> > "mod_alias:
> > This module provides for mapping different parts of the host filesystem
> in
> > the document tree, and for URL redirection.
> > <snipped>
> > Example: Alias /image /ftp/pub/image
> >
> > A request for http://myserver/image/foo.gif would cause the server to
> return
> > the file /ftp/pub/image/foo.gif."
> >
> > where as apache docs for mod_proxy says:
> >
> > This module implements a proxy/cache for Apache. It implements proxying
> > capability for FTP, CONNECT (for SSL), HTTP/0.9, HTTP/1.0, and (as of
> > Apache 1.3.23) HTTP/1.1. The module can be configured to connect to
> other
> > proxy modules for these and other protocols.
> >
> > regards,
> >
> > - Mayuresh
> >
> > On 6/13/07, Peter Brewer <pwb48 at cornell.edu> wrote:
> > >
> > > I'm having problems with mod_proxy.
> > >
> > > In some cases I just want to pass a particular subfolder for a domain
> to a
> > > different host on my intranet - in which case the following syntax
> works
> > > fine:
> > >
> > > ProxyPass "/prettyfoldername/" "
> > > http://anotherhost.domain.uk/foldernameonserver/"
> > > ProxyPassReverse "/prettyfoldername/" "
> > > http://anotherhost.domain.uk/foldernameonserver/"
> > >
> > > The problems come when I want to pass ALL traffic for a particular
> domain
> > > to a
> > > subfolder on a different host. I had presumed that the following
> syntax
> > > would work:
> > >
> > > ProxyPass "/" "http://anotherhost.domain.uk/foldernameonserver/"
> > > ProxyPassReverse "/" "http://anotherhost.domain.uk/foldernameonserver/
> "
> > >
> > > This works to a point with files in the "/var/www/foldernameonserver"
> > > served
> > > as http://prettydomain.co.uk/myfile.html. The problem is when I try
> and
> > > access a file in a subfolder
> > > /var/www/foldernameonserver/css/style.css. If I
> > > try and access the file in the following location:
> > > http://prettydomain.co.uk/css/style.css
> > >
> > > Apache errors saying in can't find the URL
> > > "/foldernameonserver/css/style.css
> > >
> > > I hope I'm making some sense!!! Any magic wand waving appreciated!
> > >
> > > Regards
> > >
> > > Peter
> > >
> > >
> > >
> >
> >
> > --
> > My Blogs:
> > http://mskadu.blogspot.com | http://mytechieself.blogspot.com |
> > http://digitalcaptures.blogspot.com
> >
>
--
My Blogs:
http://mskadu.blogspot.com | http://mytechieself.blogspot.com |
http://digitalcaptures.blogspot.com
More information about the Sclug
mailing list