Apache-ProxyRewrite
view release on metacpan or search on metacpan
ProxyRewrite.pm view on Meta::CPAN
1;
__END__
# Documentation - try 'pod2text ProxyRewrite'
=head1 NAME
Apache::ProxyRewrite - mod_perl URL-rewriting proxy
=head1 SYNOPSIS
<Location />
SetHandler perl-script
PerlHandler Apache::ProxyRewrite
PerlSetVar ProxyTo http://www.tivoli.com
PerlSetVar ProxyAuthInfo "BASIC aGb2c3ewenQ6amF4szzmY3b="
PerlSetVar ProxyAuthRedirect On
PerlSetVar ProxyRewrite "https://www.tivoli.com/secure => /secure"
</Location>
<Location /secure>
SetHandler perl-script
PerlHandler Apache::ProxyRewrite
PerlSetVar ProxyTo https://www.tivoli.com/secure
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>
( run in 1.323 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )