Perlbal::Plugin::Addheader - Add Headers to Perlbal webserver/reverse_proxy responses
Version 0.01
This module allows you to add/change headers to/from perlbal responses.
You can configure headers to be added/changed based on each service declared, although the service role has to be set to web_server or reverse_proxy.
For each header you want to add/change, you have to specify the header content, this header content can be a set of characters or Perl code that will be evaluated for each response.
This module provides a Perlbal plugin wich can be loaded and used as follows
Load Addheader #ADDHEADER <service_name> <header_name> <header_content> ADDHEADER static Server This is My Webserver CREATE SERVICE static SET ROLE = web_server SET docroot /server/static SET plugins = Addheader ENABLE static
In this case for each response served by the Service static, the header Server will be changed to This is my Webserver.
Service static
Server
This is my Webserver
In cases where you need a dynamic value to be server as header content, you can put Perl code as the header content, surrounding the header content with [% and %].
[%
%]
ADDHEADER static Expires [% {use HTTP::Date;HTTP::Date::time2str(time() + 2592000)} %]
In this case, for each response, the header Expires will be added, ant the content will be the time in exactly 30 days from the time the response has been sent .
Expires
Bruno Martins, <bruno.martins at co.sapo.pt>
<bruno.martins at co.sapo.pt>
Please report any bugs or feature requests to bug-perlbal-plugin-addheader at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perlbal-Plugin-Addheader. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-perlbal-plugin-addheader at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Perlbal::Plugin::Addheader
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perlbal-Plugin-Addheader
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Perlbal-Plugin-Addheader
CPAN Ratings
http://cpanratings.perl.org/d/Perlbal-Plugin-Addheader
Search CPAN
http://search.cpan.org/dist/Perlbal-Plugin-Addheader/
Allow add/change response headers on all services (non role dependent)
Allow add/change response headers on all services at a time (one line configuration)
Copyright 2009 Bruno Martins <bruno.martins at co.sapo.pt> and SAPO http://www.sapo.pt, all rights reserved.
http://www.sapo.pt
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Perlbal::Plugin::Addheader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perlbal::Plugin::Addheader
CPAN shell
perl -MCPAN -e shell install Perlbal::Plugin::Addheader
For more information on module installation, please visit the detailed CPAN module installation guide.