[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    CPAN module proposal for apache2 reverse proxying
From:       Beth Skwarecki <beth () highsorcery ! com>
Date:       2006-07-19 4:14:11
Message-ID: 20060719041411.GE19605 () highsorcery ! com
[Download RAW message or body]


I recently wrote a module that may be of use to others who are using apache2
for reverse proxying. I would like to make it available on CPAN.

The problem:
 
When using apache2 as a reverse proxy, the apache module mod_proxy_html (cf.
http://apache.webthing.com/mod_proxy_html/) is useful to rewrite URLs in the
HTML content that is being proxied. However, this does nothing for CSS files
(which may use URLs to refer to images) or Javascript files (which may
construct URLs and use them for various purposes). mod_proxy_html does have
an 'Extended' flag to parse css and javascript content, but (a) this only
works for scripts/styles that are in the same file as the HTML, and (b) it
doesn't actually work very well. For example, C-style comments /* ... */ may
be interpreted as URLs and rewritten.

CSS URLs are fairly easy to pick out, but there is no easy way to find URLs
in javascript, since most javascript makes URLs by concatenating strings.

The module: 

The module is a simple apache2 output filter (using Apache2::Filter) that
rewrites URLs in CSS files, and will rewrite a certain variable declaration
in javascript files so you can use that variable in creating URL strings.
The module takes parameters from the configuration file in a manner
intentionally very similar to mod_proxy_html's.

We're using this module at my workplace for reverse proxying our own
websites. To only use mod_proxy_html is pretty useless since many of the
images and javascript stop working. My module is intended as a companion
module to mod_proxy_html or a similar HTML/XML rewriting tool. 

So, I thought this module might be useful to others! I'd like to add it to
CPAN. As per the guidelines on both the cpan and mod_perl websites, I'm
asking here first for feedback and/or pointers to other modules that do a
similar job. 

I expect it would go in the Apache2:: namespace, is this correct? 

My current working title is Apache2::ProxyMiscURLRewrite . I welcome
suggestions for names that are simpler and/or more descriptive.


Looking forward to advice, warnings, and feature requests,
-beth

-- 
Beth Skwarecki
http://loxosceles.org
Bioinformatics Analyst, http://sgn.cornell.edu
print map {$x=$!=$_; $x=~s/[b-gik-oq-z]//ig; $x} (66,56,62,113)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic