Author image Bruno Martins
and 1 contributors


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
        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.

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 .


Bruno Martins, <bruno.martins at>


Please report any bugs or feature requests to bug-perlbal-plugin-addheader at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Perlbal::Plugin::Addheader

You can also look for information at:


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> and SAPO, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.