Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > main-release-src > by-pkgid > a3488e9dc091d3c5f4616db8164cc7c3 > files > 3

apache-mod_proxy_html-3.0.1-0.r123.2mdv2009.1.src.rpm

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en"><head>
<title>mod_proxy_html</title>
<style type="text/css">
@import url(/index.css) ;
</style>
</head><body>
<div id="apache">
<h1>mod_proxy_html: Configuration</h1>
<p><a href="./">mod_proxy_html</a> Version 2.4 (Sept 2004) and upwards.
<span class="v3">Updates in Version 3 (Dec. 2006) are highlighted</span>.</p>
<h2>Configuration Directives</h2>
<p>The following can be used anywhere in an <strong>httpd.conf</strong>
or included configuration file.</p>
<dl>
<dt>ProxyHTMLURLMap</dt>
<dd>
<p>Syntax:
<code>ProxyHTMLURLMap	from-pattern	to-pattern [flags] [cond]</code></p>
<p>This is the key directive for rewriting HTML links.  When parsing a document,
whenever a link target matches <samp>from-pattern</samp>, the matching
portion will be rewritten to <samp>to-pattern</samp>.</p>
<p>Starting at version 2.0, this supports a wider range of pattern-matching
and substitutions, including regular expression search and replace,
controlled by the optional third <code>flags</code> argument.
</p>
<p class="v3">Starting at version 3.0, this also supports environment variable
interpolation using the V and v flags, and rules may apply conditionally
based on an environment variable.  Note that interpolation takes place
before the parse starts, so variables set during the parse (e.g.
using SSI directives) will not apply.  This flexible configuration
is enabled by the <code>ProxyHTMLInterp</code> directive, or can
be disabled for speed.</p>
<h3>Flags for ProxyHTMLURLMap</h3>
<p>Flags are case-sensitive.</p>
<dl class="table">
<dt>h</dt>
<dd><p>Ignore HTML links (pass through unchanged)</p></dd>
<dt>e</dt>
<dd><p>Ignore scripting events (pass through unchanged)</p></dd>
<dt>c</dt>
<dd><p>Pass embedded script and style sections through untouched.</p></dd>
<dt>L</dt>
<dd><p>Last-match.  If this rule matches, no more rules are applied
(note that this happens automatically for HTML links).</p></dd>
<dt class="v3">l</dt>
<dd class="v3">Opposite to L.  Overrides the one-change-only default
behaviour with HTML links.</dd>
<dt>R</dt>
<dd><p>Use Regular Expression matching-and-replace.  <code>from-pattern</code>
is a regexp, and <code>to-pattern</code> a replacement string that may be
based on the regexp.  Regexp memory is supported: you can use brackets ()
in the <code>from-pattern</code> and retrieve the matches with $1 to $9
in the <code>to-pattern</code>.</p>
<p>If R is not set, it will use string-literal search-and-replace, as in
versions 1.x.  Logic is <em>starts-with</em> in HTML links, but
<em>contains</em> in scripting events and embedded script and style sections.
</p>
</dd>
<dt>x</dt>
<dd><p>Use POSIX extended Regular Expressions.  Only applicable with R.</p></dd>
<dt>i</dt>
<dd><p>Case-insensitive matching.  Only applicable with R.</p></dd>
<dt>n</dt>
<dd><p>Disable regexp memory (for speed).  Only applicable with R.</p></dd>
<dt>s</dt>
<dd><p>Line-based regexp matching.  Only applicable with R.</p></dd>
<dt>^</dt>
<dd><p>Match at start only.  This applies only to string matching
(not regexps) and is irrelevant to HTML links.</p></dd>
<dt>$</dt>
<dd><p>Match at end only.  This applies only to string matching
(not regexps) and is irrelevant to HTML links.</p></dd>
<dt class="v3">V</dt>
<dd class="v3"><p>Interpolate environment variables in <code>to-pattern</code>.
A string of the form <code>${varname|default}</code> will be replaced by the
value of environment variable <code>varname</code>.  If that is unset, it
is replaced by <code>default</code>.  The <code>|default</code> is optional.</p>
<p>NOTE: interpolation will only be enabled if ProxyHTMLInterp is On.</p>
</dd>
<dt class="v3">v</dt>
<dd class="v3"><p>Interpolate environment variables in <code>from-pattern</code>.
Patterns supported are as above.</p>
<p>NOTE: interpolation will only be enabled if ProxyHTMLInterp is On.</p>
</dd>
</dl>
<h3 class="v3">Conditions for ProxyHTMLURLMap</h3>
<p class="v3">The optional <code>cond</code> argument specifies a condition to
test before the parse.  If a condition is unsatisfied, the URLMap
will be ignored in this parse.</p>
<p class="v3">The condition takes the form <code>[!]var[=val]</code>, and is
satisfied if the value of environment variable <code>var</code>
is <code>val</code>.  If the optional <code>=val</code> is omitted,
then any value of <code>var</code> satisfies the condition, provided
only it is set to something.  If the first character is <code>!</code>,
the condition is reversed.</p>
<p class="v3">NOTE: conditions will only be applied if ProxyHTMLInterp is On.</p>
</dd>
<dt class="v3">ProxyHTMLInterp</dt>
<dd class="v3">
<p>Syntax: <code>ProxyHTMLInterp On|Off</code></p>
<p>Enables new (per-request) features of ProxyHTMLURLMap.</p>
</dd>
<dt>ProxyHTMLDoctype</dt>
<dd>
<p>Syntax: <code>ProxyHTMLDoctype HTML|XHTML [Legacy]</code></p>
<p>Alternative Syntax: <code>ProxyHTMLDocType fpi [SGML|XML]</code></p>
<p>In the first form, documents will be declared as HTML 4.01 or XHTML 1.0
according to the option selected.  This option also determines whether
HTML or XHTML syntax is used for output.   Note that the format of the
documents coming from the backend server is immaterial: the parser will
deal with it automatically.  If the optional second argument is set to
"Legacy", documents will be declared "Transitional", an option that may
be necessary if you are proxying pre-1998 content or working with defective
authoring/publishing tools.</p>
<p>In the second form, it will insert your own <abbr
title="Formal Public Identifier">FPI</abbr>.  The optional second
argument determines whether SGML/HTML or XML/XHTML syntax will be used.</p>
<p>Starting at version 2.0, the default is changed to omitting any FPI,
on the grounds that no FPI is better than a bogus one.  If your backend
generates decent HTML or XHTML, set it accordingly.</p>
<p class="v3">From version 3, if the first form is used, mod_proxy_html
will also clean up the HTML to the specified standard.  It cannot
fix every error, but it will strip out bogus elements and attributes.
It will also optionally log other errors at <tt>LogLevel Debug</tt>.</p>
</dd>
<dt>ProxyHTMLFixups</dt>
<dd>
<p>Syntax: <code>ProxyHTMLFixups [lowercase] [dospath] [reset]</code></p>
<p>This directive takes one to three arguments as follows:</p>
<ul>
<li><code>lowercase</code> Urls are rewritten to lowercase</li>
<li><code>dospath</code> Backslashes in URLs are rewritten to forward slashes.</li>
<li><code>reset</code> Unset any options set at a higher level in the configuration.</li>
</ul>
<p>Take care when using these.  The fixes will correct certain authoring
mistakes, but risk also erroneously fixing links that were correct to start with.
Only use them if you know you have a broken backend server.</p> 
</dd>
<dt>ProxyHTMLMeta</dt>
<dd><p>Syntax <code>ProxyHTMLMeta [On|Off]</code></p>
<p>Parses <code>&lt;meta http-equiv ...&gt;</code> elements to real HTTP
headers.</p>
<p class="v3">In version 3, this is also tied in with the improved
<a href="guide.html#charset">internationalisation support</a>, and is
required to support some character encodings.</p>
</dd>
<dt>ProxyHTMLExtended</dt>
<dd><p>Syntax <code>ProxyHTMLExtended [On|Off]</code></p>
<p>Set to <code>Off</code>, this gives the same behaviour as 1.x versions
of mod_proxy_html.  HTML links are rewritten according the ProxyHTMLURLMap
directives, but links appearing in Javascript and CSS are ignored.</p>
<p>Set to <code>On</code>, all scripting events and embedded scripts or
stylesheets are also processed by the ProxyHTMLURLMap rules, according to
the flags set for each rule.  Since this requires more parsing, performance
will be best if you only enable it when strictly necessary.</p>
</dd>
<dt>ProxyHTMLStripComments</dt>
<dd><p>Syntax <code>ProxyHTMLStripComments [On|Off]</code></p>
<p>This directive will cause mod_proxy_html to strip HTML comments.
Note that this will also kill off any scripts or styles embedded in
comments (a bogosity introduced in 1995/6 with Netscape 2 for the
benefit of then-older browsers, but still in use today).
It may also interfere with comment-based processors such as SSI or ESI:
be sure to run any of those <em>before</em> mod_proxy_html in the
filter chain if stripping comments!</p>
</dd>
<dt>ProxyHTMLLogVerbose</dt>
<dd><p>Syntax <code>ProxyHTMLLogVerbose [On|Off]</code></p>
<p>Turns on verbose logging.  This causes mod_proxy_html to make
error log entries (at <code>LogLevel Info</code>) about charset
detection and about all meta substitutions and rewrites made.
When Off, only errors and warnings (if any) are logged.</p>
</dd>
<dt>ProxyHTMLBufSize</dt>
<dd><p>Syntax <code>ProxyHTMLBufSize nnnn</code></p>
<p>Set the buffer size increment for buffering inline stylesheets and scripts.</p>
<p>In order to parse non-HTML content (stylesheets and scripts), mod_proxy_html
has to read the entire script or stylesheet into a buffer.  This buffer will
be expanded as necessary to hold the largest script or stylesheet in a page,
in increments of [nnnn] as set by this directive.</p>
<p>The default is 8192, and will work well for almost all pages.  However,
if you know you're proxying a lot of pages containing stylesheets and/or
scripts bigger than 8K (that is, for a single script or stylesheet,
NOT in total), it will be more efficient to set a larger buffer
size and avoid the need to resize the buffer dynamically during a request.
</p>
</dd>
<dt class="v3">ProxyHTMLEvents</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLEvents attr [attr ...]</code></p>
<p>Specifies one or more attributes to treat as scripting events and
apply URLMaps to where appropriate.  You can specify any number of
attributes in one or more <code>ProxyHTMLEvents</code> directives.
The <a href="/svn/apache/filters/proxy_html/">sample configuration</a>
defines the events in standard HTML 4 and XHTML 1.</p>
</dd>
<dt class="v3">ProxyHTMLLinks</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLLinks elt attr [attr ...]</code></p>
<p>Specifies elements that have URL attributes that should be rewritten
using standard URLMaps as in versions 1 and 2 of mod_proxy_html.
You will need one <code>ProxyHTMLLinks</code> directive per element,
but it can have any number of attributes.  The <a
href="/svn/apache/filters/proxy_html/">sample configuration</a>
defines the HTML links for standard HTML 4 and XHTML 1.</p>
</dd>
<dt class="v3">ProxyHTMLCharsetAlias</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLCharsetAlias charset alias [alias ...]</code></p>
<p>This server-wide directive aliases one or more charset to another
charset.  This enables encodings not recognised by libxml2 to be handled
internally by libxml2's charset support using the translation table for
a recognised charset.</p>
<p>For example, Latin 1 (<tt>ISO-8859-1</tt>) is supported by libxml2.
Microsoft's <tt>Windows-1252</tt> is almost identical and can be supported
by aliasing it:<br />
<code>ProxyHTMLCharsetAlias ISO-8859-1 Windows-1252</code></p>
</dd>
<dt class="v3">ProxyHTMLCharsetDefault</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLCharsetDefault name</code></p>
<p>This defines the default encoding to assume when absolutely no charset
information is available from the backend server.  The default value for
this is <code>ISO-8859-1</code>, as specified in HTTP/1.0 and assumed in
earlier mod_proxy_html versions.</p>
</dd>
<dt class="v3">ProxyHTMLCharsetOut</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLCharsetOut name</code></p>
<p>This selects an encoding for mod_proxy_html output.  It should not
normally be used, as any change from the default <code>UTF-8</code>
(Unicode - as used internally by libxml2) will impose an additional
processing overhead.  The special token <code>ProxyHTMLCharsetOut *</code>
will generate output using the same encoding as the input.</p>
</dd>
<dt class="v3">ProxyHTMLStartParse</dt>
<dd class="v3">
<p>Syntax <code>ProxyHTMLStartParse element [elt*]</code></p>
<p>Specify that the HTML parser should start at the first instance
of any of the elements specified.  This can be used where a broken
backend inserts leading junk that messes up the parser (<a
href="http://bahumbug.wordpress.com/2006/10/12/mod_proxy_html-revisited/"
>example here</a>).</p>
</dd>
</dl>
<h3>Other Configuration</h3>
<p class="v3">Normally, mod_proxy_html will refuse to run when not
in a proxy or when the contents are not HTML.  This can be overridden
(at your own risk) by setting the environment variable
<tt>PROXY_HTML_FORCE</tt> (e.g. with the <tt>SetEnv</tt> directive).</p>
</div>
<div id="navbar"><a class="internal" href="./" title="Up">Up</a>
*
<a class="internal" href="/" title="WebThing Apache Centre">Home</a>
*
<a class="internal" href="/contact.html" title="Contact WebThing">Contact</a>
*
<a class="external" href="http://www.webthing.com/" title="WebThing Ltd">Web&#222;ing</a>
*
<a class="external" href="http://www.apache.org/" title="Apache Software Foundation">Apache</a></div></body></html>