[svn-inject] Applying Debian modifications to trunk
[manu/mod-proxy-html.git] / config.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html lang="en"><head>
4 <title>mod_proxy_html</title>
5 <style type="text/css">
6 @import url(/index.css) ;
7 </style>
8 </head><body>
9 <div id="apache">
10 <h1>mod_proxy_html: Configuration</h1>
11 <p><a href="./">mod_proxy_html</a> Version 2.4 (Sept-Nov 2004)</p>
12 <h2>Configuration Directives</h2>
13 <p>The following can be used anywhere in an <strong>httpd.conf</strong>
14 or included configuration file.</p>
15 <dl>
16 <dt>ProxyHTMLURLMap</dt>
17 <dd>
18 <p>Syntax:
19 <code>ProxyHTMLURLMap   from-pattern    to-pattern flags</code></p>
20 <p>This is the key directive for rewriting HTML links.  When parsing a document,
21 whenever a link target matches <samp>from-pattern</samp>, the matching
22 portion will be rewritten to <samp>to-pattern</samp>.</p>
23 <p>Starting at version 2.0, this supports a wider range of pattern-matching
24 and substitutions, including regular expression search and replace,
25 controlled by the optional third <code>flags</code> argument.
26 </p>
27 <h3>Flags for ProxyHTMLURLMap</h3>
28 <p>Flags are case-sensitive.</p>
29 <dl class="table">
30 <dt>h</dt>
31 <dd><p>Ignore HTML links (pass through unchanged)</p></dd>
32 <dt>e</dt>
33 <dd><p>Ignore scripting events (pass through unchanged)</p></dd>
34 <dt>c</dt>
35 <dd><p>Pass embedded script and style sections through untouched.</p></dd>
36 <dt>L</dt>
37 <dd><p>Last-match.  If this rule matches, no more rules are applied
38 (note that this happens automatically for HTML links).</p></dd>
39 <dt>R</dt>
40 <dd><p>Use Regular Expression matching-and-replace.  <code>from-pattern</code>
41 is a regexp, and <code>to-pattern</code> a replacement string that may be
42 based on the regexp.  Regexp memory is supported: you can use brackets ()
43 in the <code>from-pattern</code> and retrieve the matches with $1 to $9
44 in the <code>to-pattern</code>.</p>
45 <p>If R is not set, it will use string-literal search-and-replace, as in
46 versions 1.x.  Logic is <em>starts-with</em> in HTML links, but
47 <em>contains</em> in scripting events and embedded script and style sections.
48 </p>
49 </dd>
50 <dt>x</dt>
51 <dd><p>Use POSIX extended Regular Expressions.  Only applicable with R.</p></dd>
52 <dt>i</dt>
53 <dd><p>Case-insensitive matching.  Only applicable with R.</p></dd>
54 <dt>n</dt>
55 <dd><p>Disable regexp memory (for speed).  Only applicable with R.</p></dd>
56 <dt>s</dt>
57 <dd><p>Line-based regexp matching.  Only applicable with R.</p></dd>
58 <dt>^</dt>
59 <dd><p>Match at start only.  This applies only to string matching
60 (not regexps) and is irrelevant to HTML links.</p></dd>
61 <dt>$</dt>
62 <dd><p>Match at end only.  This applies only to string matching
63 (not regexps) and is irrelevant to HTML links.</p></dd>
64 </dl>
65 <!-- <h4>Examples</h4> -->
66 </dd>
67 <dt>ProxyHTMLDoctype</dt>
68 <dd>
69 <p>Syntax: <code>ProxyHTMLDoctype HTML|XHTML [Legacy]</code></p>
70 <p>Alternative Syntax: <code>ProxyHTMLDocType fpi [SGML|XML]</code></p>
71 <p>In the first form, documents will be declared as HTML 4.01 or XHTML 1.0
72 according to the option selected.  This option also determines whether
73 HTML or XHTML syntax is used for output.   Note that the format of the
74 documents coming from the backend server is immaterial: the parser will
75 deal with it automatically.  If the optional second argument is set to
76 "Legacy", documents will be declared "Transitional", an option that may
77 be necessary if you are proxying pre-1998 content or working with defective
78 authoring/publishing tools.</p>
79 <p>In the second form, it will insert your own <abbr
80 title="Formal Public Identifier">FPI</abbr>.  The optional second
81 argument determines whether SGML/HTML or XML/XHTML syntax will be used.</p>
82 <p>Starting at version 2.0, the default is changed to omitting any FPI,
83 on the grounds that no FPI is better than a bogus one.  If your backend
84 generates decent HTML or XHTML, set it accordingly.</p>
85 </dd>
86 <dt>ProxyHTMLFixups</dt>
87 <dd>
88 <p>Syntax: <code>ProxyHTMLFixups [lowercase] [dospath] [reset]</code></p>
89 <p>This directive takes one to three arguments as follows:</p>
90 <ul>
91 <li><code>lowercase</code> Urls are rewritten to lowercase</li>
92 <li><code>dospath</code> Backslashes in URLs are rewritten to forward slashes.</li>
93 <li><code>reset</code> Unset any options set at a higher level in the configuration.</li>
94 </ul>
95 <p>Take care when using these.  The fixes will correct certain authoring
96 mistakes, but risk also erroneously fixing links that were correct to start with.
97 Only use them if you know you have a broken backend server.</p> 
98 </dd>
99 <dt>ProxyHTMLMeta</dt>
100 <dd><p>Syntax <code>ProxyHTMLMeta [On|Off]</code></p>
101 <p>Parses <code>&lt;meta http-equiv ...&gt;</code> elements to real HTTP
102 headers.</p>
103 </dd>
104 <dt>ProxyHTMLExtended</dt>
105 <dd><p>Syntax <code>ProxyHTMLExtended [On|Off]</code></p>
106 <p>Set to <code>Off</code>, this gives the same behaviour as 1.x versions
107 of mod_proxy_html.  HTML links are rewritten according the ProxyHTMLURLMap
108 directives, but links appearing in Javascript and CSS are ignored.</p>
109 <p>Set to <code>On</code>, all scripting events and embedded scripts or
110 stylesheets are also processed by the ProxyHTMLURLMap rules, according to
111 the flags set for each rule.  Since this requires more parsing, performance
112 will be best if you only enable it when strictly necessary.</p>
113 </dd>
114 <dt>ProxyHTMLStripComments</dt>
115 <dd><p>Syntax <code>ProxyHTMLStripComments [On|Off]</code></p>
116 <p>This directive will cause mod_proxy_html to strip HTML comments.
117 Note that this will also kill off any scripts or styles embedded in
118 comments (a bogosity introduced in 1995/6 with Netscape 2 for the
119 benefit of then-older browsers, but still in use today).
120 It may also interfere with comment-based processors such as SSI or ESI:
121 be sure to run any of those <em>before</em> mod_proxy_html in the
122 filter chain if stripping comments!</p>
123 </dd>
124 <dt>ProxyHTMLLogVerbose</dt>
125 <dd><p>Syntax <code>ProxyHTMLLogVerbose [On|Off]</code></p>
126 <p>Turns on verbose logging.  This causes mod_proxy_html to make
127 error log entries (at <code>LogLevel Info</code>) about charset
128 detection and about all meta substitutions and rewrites made.
129 When Off, only errors and warnings (if any) are logged.</p>
130 </dd>
131 <dt>ProxyHTMLBufSize</dt>
132 <dd><p>Syntax <code>ProxyHTMLBufSize nnnn</code></p>
133 <p>Set the buffer size increment for buffering inline stylesheets and scripts.</p>
134 <p>In order to parse non-HTML content (stylesheets and scripts), mod_proxy_html
135 has to read the entire script or stylesheet into a buffer.  This buffer will
136 be expanded as necessary to hold the largest script or stylesheet in a page,
137 in increments of [nnnn] as set by this directive.</p>
138 <p>The default is 8192, and will work well for almost all pages.  However,
139 if you know you're proxying a lot of pages containing stylesheets and/or
140 scripts bigger than 8K, it will be more efficient to set a larger buffer
141 size and avoid the need to resize the buffer dynamically during a request.
142 </p>
143 </dd>
144 </dl>
145 </div>
146 </body></html>