You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matt Richards <ma...@mattstone.net> on 2006/04/08 18:46:29 UTC

[users@httpd] Reverse proxy by file ext / type

Hello :)

I have httpd running for a web interface to a like control site and all 
requests to access users files are reverse proxied to a windows box due 
to the requirment for asp support.
Everything is working fine although I would just like to add support for 
perl scripts using mod_perl

I have a freebsd box running on this network that has the ablity to 
parse perl files through mod_perl and apache, however, I dont want the 
users to have to goto a different address to just parse perl scripts so 
I would like to setup the already setup apache that is proxying 
everything to a given domain to the win box.

I would like to set it up so if a request for a file with a ext of .pl 
it will get proxied to the freebsd box and not the win box.
or .. i would like the same but for anything thats under 
http://domain/userid/perl/ but for every user.

I would also like to keep the configuration as simple as possiable as it 
is already starting to get quite complicated.

Does anybody know how this can be done?

Cheers,

Matt.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Reverse proxy by file ext / type

Posted by Nick Kew <ni...@webthing.com>.
On Saturday 08 April 2006 17:46, Matt Richards wrote:

> I would like to set it up so if a request for a file with a ext of .pl
> it will get proxied to the freebsd box and not the win box.
> or .. i would like the same but for anything thats under
> http://domain/userid/perl/ but for every user.

As an alternative to what Joshua said, you could use <LocationMatch>
to define your URL spaces and avoid the need for mod_rewrite.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Reverse proxy by file ext / type

Posted by Joshua Slive <jo...@slive.ca>.
On 4/8/06, Matt Richards <ma...@mattstone.net> wrote:
> Hello :)
>
> I have httpd running for a web interface to a like control site and all
> requests to access users files are reverse proxied to a windows box due
> to the requirment for asp support.
> Everything is working fine although I would just like to add support for
> perl scripts using mod_perl
>
> I have a freebsd box running on this network that has the ablity to
> parse perl files through mod_perl and apache, however, I dont want the
> users to have to goto a different address to just parse perl scripts so
> I would like to setup the already setup apache that is proxying
> everything to a given domain to the win box.
>
> I would like to set it up so if a request for a file with a ext of .pl
> it will get proxied to the freebsd box and not the win box.
> or .. i would like the same but for anything thats under
> http://domain/userid/perl/ but for every user.
>
> I would also like to keep the configuration as simple as possiable as it
> is already starting to get quite complicated.
>
> Does anybody know how this can be done?

RewriteEngine On
RewriteRule ^/(.*\.pl)$ http://perl-box.example.com/userid/$1[P,L]
RewriteRule ^/(.*) http://other-box.example.com/$1 [P]
ProxyPassReverse / http://other-box.example.com/

(Your problem isn't well-specified enough to do a complete
configuration, but that should give you an idea.)

Note that the ProxyPassReverse directive can only work for one of
those.  So you would need to be careful that the perl scripts didn't
generate redirects that need rewriting.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org