Apache2::CondProxy - Intelligent reverse proxy for missing resources
Version 0.11
# httpd.conf PerlFixupHandler Apache2::CondProxy PerlSetVar ProxyTarget http://another.host/ PerlSetVar RequestBodyCache /tmp
This module performs the logic required to achieve what is implied by the following Apache configuration:
# httpd.conf RewriteEngine On RewriteCond %{REQUEST_URI} !-U RewriteRule (.*) http://another.host$1 [P,NS]
Which says if I can't respond to a given request, try another.host. Unfortunately, the architecture of mod_rewrite, as well as the design of Apache's handler model itself, prohibits this. In the first case, all RewriteCond directives are evaluated after the associated RewriteRule. In the second, the response code is initialized to 200 and remains that way until it is changed, most likely by a response handler which never gets run. This confluence of behaviour makes the above configuration not do what we imagine it would.
RewriteCond
RewriteRule
200
This module works by running the request all the way through in a subrequest. Before doing so, a filter is installed to trap the subrequest's response. If the response is unsuccessful, the filter disposes of the error body, and the request is forwarded to the proxy target.
Dorian Taylor, <dorian at cpan.org>
<dorian at cpan.org>
Please report any bugs or feature requests to bug-apache2-filterfun at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Apache2-CondProxy. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-apache2-filterfun at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Apache2::CondProxy
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-CondProxy
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Apache2-CondProxy
CPAN Ratings
http://cpanratings.perl.org/d/Apache2-CondProxy
Search CPAN
http://search.cpan.org/dist/Apache2-CondProxy/
Copyright 2013 Dorian Taylor.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 .
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Apache2::CondProxy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache2::CondProxy
CPAN shell
perl -MCPAN -e shell install Apache2::CondProxy
For more information on module installation, please visit the detailed CPAN module installation guide.