Apache-ProxyRewrite

 view release on metacpan or  search on metacpan

ProxyRewrite.pm  view on Meta::CPAN

 PerlSetVar   ProxyAuthInfo     "BASIC aGb2c3ewenQ6amF4szzmY3b="
 PerlSetVar   ProxyAuthRedirect Off
 PerlSetVar   ProxyRewrite      "http://www.tivoli.com/ => /"
 </Location>

=head1 DESCRIPTION

B<Apache::ProxyRewrite> acts as a reverse-proxy that will rewrite
URLs embedded in HTML documents per apache configuration
directives.

This module was written to allow multiple backend services with
discrete URLs to be presented as one service and to allow the
proxy to do authentication on the client's behalf.

=head1 CONFIGURATION OPTIONS

The following variables can be defined within the configration of
Directory, Location, or Files blocks.

=over 4

=item B<ProxyTo>

The URL for which ProxyRewrite will proxy its requests.

=back

=over 4

=item B<ProxyAuthInfo>

Authorization information for proxied requests. This string must
conform to the credentials string defined in section 11 of RFC
2068.

=back

=over 4

=item B<ProxyAuthRedirect>

If the credentials supplied in the ProxyAuthInfo directive are
insufficient and if ProxyAuthRedirect is set to On, the proxy
server will redirect the client directly to the backend host. If
ProxyAuthRedirect is set to Off (the default), the proxy server
will challenge the client on the remote server's behalf.

=back

=over 4

=item B<ProxyRewrite>

A hash of URLs to rewrite. A note on hashes in configuration
directives from the "Writing Apache Modules with Perl and C"
book page 287:

  The only trick is to remember to put double quotes around the
  configuration value if it contains whitespace and not to allow
  your text editor to wrap it to another line. You can use
  backslash as a continuation character if you find long lines a
  pain to read.

=back

=head1 NOTES

=over 4

=item B<Automatic mappings>

ProxyRewrite automatically adds a mapping for the remote relative
URI and the current location. An example:

  ServerName   proxyhost

  <Location    /foo>
  PerlSetVar   ProxyTo   http://server1/A
  </Location>

The request for http://proxyhost/foo/B is proxied to
http://server1/A/B. Within the response from server1 is an
embedded URI /A/C. This URI is rewritten to /foo/C before being
returned to the client.

=back

=over 4

=item B<Embedded Languages>

Embedded languages such as Javascript are not parsed for embedded
URLs. The problem is NP-Complete. The best choice is to surround
all embedded languages in HTML comments to avoid possible parsing
problems.

=back

=over 4

=item B<Parser Notes>

The parser takes a single pass through each HTML document. This
method is extremely efficient, but it has possible drawbacks with
poorly constructed HTML. All known drawbacks have been
eliminated, but more may exist. Please contact the author if you
have any trouble with parsed output.

=back

=over 4

=item B<Special Thanks>

A special thanks goes to my co-authors of absent, from which much
of the rewriting code comes, Dave Korman and Avi Rubin. Absent is
a system for secure remote access to an organization's internal
web from outside its firewall. To learn more about absent, go to
http://www.research.att.com/projects/absent/.



( run in 1.196 second using v1.01-cache-2.11-cpan-39bf76dae61 )