Home | Download | Documentation | Support | License

Description

Apache2::ModProxyPerlHtml is the most advanced Apache output filter to rewrite HTTP headers and HTML links for reverse proxy usage. It is written in Perl and exceeds all mod_proxy_html.c limitations without performance lost.

Apache2::ModProxyPerlHtml is very simple and has far better parsing/replacement of URL than the original C code. It also support meta tag, CSS, and javascript URL rewriting and can be use with compressed HTTP. You can now replace any code by other, like changing images name or anything else. mod_proxy_html can't do all of that. Since release 3.0 ModProxyPerlHtml is also able to rewrite HTTP headers with refresh url redirection. One of the common used of ModProxyPerlHtml is as free replacement for Microsoft TM ISA servers.

The replacement capability concern only the following HTTP content type:

  • text/javascript
  • text/html
  • text/css
  • text/xml
  • application/.*javascript
  • application/.*xml
other kind of file, will be left untouched (or see ProxyHTMLContentType configuration directive).

News

July 2013, Sunday 28

This release adds a new configuration directive ProxyHtmlExcludeUri to allow some URIs to be excluded from rewritting and fix issue with regex pattern in ProxyHTMLRewrite directive.

        - Make replace pattern an evalable expression so that you can use $1 in
          replacement pattern with ProxyHTMLRewrite. Thanks to Roberto Majadas
          for the report.
        - Update documentation about AddHandler vs SetHandler to avoid error
          "Attempt to serve directory", with SetHandler DirectoryIndex is not
          working any more. Thanks to Brad Robertson for the report.
        - Add PerlAddVar before examples in documentation.
        - Add new directive ProxyHtmlExcludeUri to allow URIs to be excluded
          from any rewritting. This is to be used to fix some weird replacements
          in javascript library. Thanks to Brad Robertson for the report.

August 2012, Wednesday 15

Apache2::ModProxyPerlHtml v3.4 is now available for download at SourceForge.net. There's also a git repository available at GitHub.org for development source code and support.

December 2012, Tuesday 11

This release allow to rewrite the referer in the HTTP header and fix the documentation.

        - Fix documentation about ProxyHTMLContentType, PerlAddVar was missing.
          Thanks to cepelessar for the report.
        - Allow rewrite of Referer value into the HTTP header. Thanks to snadal
          for the feature request.

August 2012, Wednesday 15

Release 3.4 has been published. It adds support to white space in ProxyHTMLRewrite and ProxyHTMLURLMap configuration directives.

        - Add support of space characters in ProxyHTMLURLMap an ProxyHTMLRewrite
          pattern definition. The issue reported by Steffen Rheinhold occurs
          when you want to rewrite some HTML code with space character in it.
          As space is the separator character used between the search pattern
          and the string to substitute. For exemple writing such a replacement:

                PerlAddVar ProxyHTMLRewrite "ajaxurl[\t\s]+=[\t\s]+'/blog' ajaxurl = '/www2.domain.org/blog'"

          is now fully supported, before it should break after the first space
          of the replacement string and using '\s' in this replacement string
          will not solve the problem as it still write 's' instead of a space.

June 2012, Tuesday 26

Release 3.3 is out. It fixes cases of openxml MS Office document corrupted by ModProxyPerlHtml XML code replacements.

        - Fix corruption of openxml MS Office document (docx, dotx, potx, ppsx,
          pptx, xlsx and xltx). Thanks to Stefano Colanzi for the report.
        - Add new directive ProxyHTMLExcludeContentType with default value to
          regex: (application\/vnd\.openxml) to fix the previous issue and let
          users customize the content-type exclusion regex.
        - Add development code to github.com new repository:
                https://github.com/darold/modproxyperlhtml

December 2011, Wednesday 21

Release 3.2 is out to quick fix a bug introduced into the previous release on inflate/deflate compressed http content. It also adds more debug messages to trace link substitutions in refresh header, http content and into the inflate/deflate calls.

- Fix new major issue during inflate/deflate compressed http content
  introduced in last release. Thanks to Claude Durocher and Eduardo
  Paez Trujillo for the report.
- Add debug messages in verbose mode to trace link substitutions in
  refresh header and http content. Code with inflate/deflate calls will
  also be logged.
- Replace call to the warn log method by method Apache2::ServerRec::warn
  to add timestamp to verbose trace.

Note that you can always use: RequestHeader unset Accept-Encoding
to disable the use of compressed HTTP on remote server side.

December 2011, Wednesday 14

Release 3.1 was upload to CPAN, This release adds support for XML content-type rewrite and fix a major bug in inflate/deflate compressed http content that could corrupt the download of a zip or gzip compressed archive. It also adds support to the 'formaction' HTML5 attribut. Here is the complete ChangeLog:

- Fix major bug in inflate/deflate compressed http content. It appears when ModProxyPerlHTML try to uncompressed a gzip
  file with multiple file and result in compressed archive corruption. Thanks to Eduardo Paez Trujillo for the report.
- Add support for XML content-type to be rewritten. Thanks to Claude Durocher for the report.
- Add an Apache2/Mod_perl configuration directive to allow user defined content type. See ProxyHTMLContentType
  configuration directive, with default value to actual parsed content-type.
- Modify documentation to refect change.
- Add support to HTML5 'formaction' new attribute on input and button elements.

Upgrade: just reinstall ModProxyPerlHtml and restart your httpd daemon. Old Apache configuration is fully compatible.

November 2010, Sunday 14

Release 3.0 was upload to CPAN, http headers with Refresh Urls is now fully supported. Here is the ChangeLog:

- Add support to refresh in HTTP header. Thanks to Peter Stubbs for the feature request.
- Documentation reviewed.
- Creation of a dedicated site at http://modproxyhtml.darold.net/
- The major release version is just to mark the creation of the web site, there's no major change.
  Old Apache configuration is fully compatible.

History

Apache::ModProxyPerlHTML was created in 2005 when I have to setup a reverse proxy to give access to 2500 users to an internal webmail and webcalendar. After testing a day mod_proxy_html.c I had two choices: say that this is not possible because mod_proxy_html.c simply can't do the work or implementing my own Apache module for reverse proxy HTML rewriter. Well, you know the answer.

Apache::ModProxyPerlHTML is hosted on CPAN since June 2008. See Download menu.

Apache2::ModProxyPerlHTML is also used by Vulture an advanced HTTP reverse proxy.

Development

	Total Physical Source Lines of Code = 209
	Total Estimated Cost to Develop     = $ 5,221
	(Generated using David A. Wheeler's 'SLOCCount'.)

Help support ModProxyPerlHtml