perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Lenio <modp...@lenio.net>
Subject Re: proxy question: URL with parameters
Date Fri, 21 Oct 2005 20:00:32 GMT
Well the main reason is simple: I like programming in Perl and so I
specifically want to learn more about mp2.  mod_proxy is of limited use to me
because eventually I will want to do some sophisticated URL rewriting.  For now
I want to get my example working, then on to more advanced things (where I can
tap into Perl's vast set of features & modules).  I don't *want* to learn the
ins & outs of mod_proxy or mod_rewrite; I want to do it the Perl way.

2 people have now questioned why I am using mod_perl for the solution...  this
is strange to me because I expect people on this list to look for EXCUSES to
use mp2... come on, how about some mp2 advocacy???

On Fri, Oct 21, 2005 at 03:45:25PM -0400, Adam Prime x443 wrote:
> Are there reasons you don't want to use mod_proxy, or Apache::ProxyRewrite
> (ProxyRewrite may not work on mp2)?
> 
> Adam
> 
> -----Original Message-----
> From: Eric Lenio [mailto:modperl@lenio.net]
> Sent: Thursday, October 20, 2005 10:57 PM
> To: Philip M. Gollucci
> Cc: Eric Lenio; modperl@perl.apache.org
> Subject: Re: proxy question: URL with parameters
> 
> 
> On Thu, Oct 20, 2005 at 10:47:02PM -0400, Philip M. Gollucci wrote:
> > Eric Lenio wrote:
> > >The handler converts the question mark to %3f and the proxy request 
> > >basically
> > >fails.  I'm using modperl 1.99.11, I'd like to fix this before moving in to
> > >2.0.2.  Suggestions?
> > Post the relevant configs please.
> 
> Here are the key parts of the code.  Anything else Philip?
> 
> package LenioApache::RewriteURI;
> 
> use strict;
> use warnings;
> 
> use Apache::RequestRec ();
> 
> use Apache::Const -compile => qw(DECLINED :common);
> 
> sub handler {
>   my $r = shift;
>   my $hostname = $r->hostname;
>   my $port     = $r->get_server_port;
>   my $real_url = $r->unparsed_uri;
>   if ($hostname =~ m{^hplg2\.}i) {
>     $r->proxyreq(1);
>     $r->uri($real_url);
>     $r->filename(sprintf "proxy:http://192.168.0.4:8080%s",$real_url);
>     $r->handler('proxy-server');
>     return Apache::OK;
>   }
>   return Apache::DECLINED;
> }
> 1;
> 

Mime
View raw message