X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=docs%2Fmanual%2Fmod%2Fmod_proxy_html.html.en;h=d67e954a12c4ec19f94a114b6b48c4e7f7713191;hb=0ae5b1af6b6bf3048d2a124e84905f63d6507dea;hp=96262f0de5635790072f8f19dc075f076e0f0942;hpb=ede1b2f024c3a0ee845f04aa6844f5f430ac2cfa;p=apache diff --git a/docs/manual/mod/mod_proxy_html.html.en b/docs/manual/mod/mod_proxy_html.html.en index 96262f0de5..d67e954a12 100644 --- a/docs/manual/mod/mod_proxy_html.html.en +++ b/docs/manual/mod/mod_proxy_html.html.en @@ -1,23 +1,28 @@ - -mod_proxy_html - Apache HTTP Server +mod_proxy_html - Apache HTTP Server Version 2.5 - + + + + +

Apache HTTP Server Version 2.5

+
<-
-Apache > HTTP Server > Documentation > Version 2.3 > Modules
+Apache > HTTP Server > Documentation > Version 2.5 > Modules

Apache Module mod_proxy_html

@@ -32,9 +37,21 @@ from Clients' networks in a proxy context. for earlier 2.x versions

Summary

-

This module provides an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. It serves the same purpose as Apache's ProxyPassReverse directive does for HTTP headers, and is an essential component of a reverse proxy.

+

This module provides an output filter to rewrite HTML links in a +proxy situation, to ensure that links work for users outside the proxy. +It serves the same purpose as Apache's ProxyPassReverse directive does +for HTTP headers, and is an essential component of a reverse proxy.

-

For example, if a company has an application server at appserver.example.com that is only visible from within the company's internal network, and a public webserver www.example.com, they may wish to provide a gateway to the application server at http://www.example.com/appserver/. When the application server links to itself, those links need to be rewritten to work through the gateway. mod_proxy_html serves to rewrite <a href="http://appserver.example.com/foo/bar.html">foobar</a> to <a href="http://www.example.com/appserver/foo/bar.html">foobar</a> making it accessible from outside.

+

For example, if a company has an application server at +appserver.example.com that is only visible from within +the company's internal network, and a public webserver +www.example.com, they may wish to provide a gateway to the +application server at http://www.example.com/appserver/. +When the application server links to itself, those links need to be +rewritten to work through the gateway. mod_proxy_html serves to rewrite +<a href="http://appserver.example.com/foo/bar.html">foobar</a> to +<a href="http://www.example.com/appserver/foo/bar.html">foobar</a> +making it accessible from outside.

mod_proxy_html was originally developed at WebÞing, whose extensive documentation may be useful to users.

@@ -50,11 +67,13 @@ extensive documentation
  • ProxyHTMLFixups
  • ProxyHTMLInterp
  • ProxyHTMLLinks
  • -
  • ProxyHTMLLogVerbose
  • +
  • ProxyHTMLMeta
  • ProxyHTMLStripComments
  • ProxyHTMLURLMap
  • -
    +

    Bugfix checklist

    See also

    +
    top

    ProxyHTMLBufSize Directive

    @@ -68,12 +87,13 @@ stylesheets. Compatibility:Version 2.4 and later; available as a third-party for earlier 2.x versions -

    In order to parse non-HTML content (stylesheets and scripts), mod_proxy_html +

    In order to parse non-HTML content (stylesheets and scripts) embedded +in HTML documents, 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.

    +in increments of bytes as set by this directive.

    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 +if you know you're proxying 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. @@ -104,7 +124,10 @@ will generate output using the same encoding as the input.

    +
    ProxyHTMLDocType fpi [SGML|XML]
    OR +
    ProxyHTMLDocType html5
    OR +
    ProxyHTMLDocType auto + @@ -121,13 +144,13 @@ be necessary if you are proxying pre-1998 content or working with defective authoring/publishing tools.

    In the second form, it will insert your own FPI. The optional second argument determines whether SGML/HTML or XML/XHTML syntax will be used.

    -

    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.

    +

    The third form declares documents as HTML 5.

    +

    The fourth form is new in HTTPD trunk and not yet available in released +versions, and uses libxml2's HTML parser to detect the doctype.

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

    +It will also optionally log other errors at LogLevel Debug.

    top
    @@ -135,6 +158,7 @@ It will also optionally log other errors at + @@ -162,11 +186,14 @@ module for earlier 2.x versions. for earlier 2.x versions
    Description:Sets an HTML or XHTML document type declaration.
    Syntax:ProxyHTMLDocType HTML|XHTML [Legacy]
    OR -
    ProxyHTMLDocType fpi [SGML|XML]
    Default:ProxyHTMLDocType auto (2.5/trunk versions); no FPI (2.4.x)
    Context:server config, virtual host, directory
    Status:Base
    Module:mod_proxy_html
    Description:Turns the proxy_html filter on or off.
    Syntax:ProxyHTMLEnable On|Off
    Default:ProxyHTMLEnable Off
    Context:server config, virtual host, directory
    Status:Base
    Module:mod_proxy_html

    Specifies one or more attributes to treat as scripting events and -apply ProxyHTMLURLMaps to where appropriate. +apply ProxyHTMLURLMaps to where enabled. You can specify any number of attributes in one or more ProxyHTMLEvents directives.

    -

    The default configuration defines the events in standard HTML 4 -and XHTML 1.

    +

    Normally you'll set this globally. If you set ProxyHTMLEvents in more than +one scope so that one overrides the other, you'll need to specify a complete +set in each of those scopes.

    +

    A default configuration is supplied in proxy-html.conf +and defines the events in standard HTML 4 and XHTML 1.

    top
    @@ -175,19 +202,27 @@ and XHTML 1.

    Description:Determines whether to fix links in inline scripts, stylesheets, and scripting events. Syntax:ProxyHTMLExtended On|Off +Default:ProxyHTMLExtended Off Context:server config, virtual host, directory Status:Base Module:mod_proxy_html Compatibility:Version 2.4 and later; available as a third-party for earlier 2.x versions -

    Set to Off, HTML links are rewritten according +

    Set to Off, HTML links are rewritten according to the ProxyHTMLURLMap directives, but links appearing in Javascript and CSS are ignored.

    -

    Set to On, all scripting events and embedded scripts or +

    Set to On, all scripting events (as determined by +ProxyHTMLEvents) 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.

    +parsing, performance will be best if you only enable it when strictly necessary. +

    +You'll also need to take care over patterns matched, since the parser has no +knowledge of what is a URL within an embedded script or stylesheet. +In particular, extended matching of / is likely to lead to +false matches. +

    top
    @@ -209,7 +244,7 @@ for earlier 2.x versions

    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.

    +Only use them if you know you have a broken backend server.

    top
    @@ -218,6 +253,7 @@ Only use them if you know you have a broken backend server.

    Description:Enables per-request interpolation of ProxyHTMLURLMap rules. Syntax:ProxyHTMLInterp On|Off +Default:ProxyHTMLInterp Off Context:server config, virtual host, directory Status:Base Module:mod_proxy_html @@ -246,26 +282,47 @@ for earlier 2.x versions

    Specifies elements that have URL attributes that should be rewritten using standard ProxyHTMLURLMaps. You will need one ProxyHTMLLinks directive per element, but it can have any number of attributes.

    -

    The default configuration defines the HTML links for standard HTML 4 -and XHTML 1.

    +

    Normally you'll set this globally. If you set ProxyHTMLLinks in more than +one scope so that one overrides the other, you'll need to specify a complete +set in each of those scopes.

    +

    A default configuration is supplied in proxy-html.conf +and defines the HTML links for standard HTML 4 and XHTML 1.

    top
    -

    ProxyHTMLLogVerbose Directive

    +

    ProxyHTMLMeta Directive

    - - + + + +module for earlier 2.x versions.
    Description:Enables extra verbose logging for debug
    Syntax:ProxyHTMLLogVerbose On|Off
    Description:Turns on or off extra pre-parsing of metadata in HTML +<head> sections.
    Syntax:ProxyHTMLMeta On|Off
    Default:ProxyHTMLMeta Off
    Context:server config, virtual host, directory
    Status:Base
    Module:mod_proxy_html
    Compatibility:Version 2.4 and later; available as a third-party -for earlier 2.x versions
    -

    If On, mod_proxy_html will log extra diagnostic information (at -LogLevel Info) -including charset detection and processing and -ProxyHTMLURLMap matches and rewrites. -This may be helpful in debugging a configuration.

    +

    This turns on or off pre-parsing of metadata in HTML + <head> sections.

    +

    If not required, turning ProxyHTMLMeta Off will give a small + performance boost by skipping this parse step. However, it + is sometimes necessary for internationalisation to work correctly.

    +

    ProxyHTMLMeta has two effects. Firstly and most importantly + it enables detection of character encodings declared in the form

    +
    <meta http-equiv="Content-Type" content="text/html;charset=foo">
    +

    or, in the case of an XHTML document, an XML declaration. + It is NOT required if the charset is declared in a real HTTP header + (which is always preferable) from the backend server, nor if the + document is utf-8 (unicode) or a subset such as ASCII. + You may also be able to dispense with it where documents use a + default declared using xml2EncDefault, but that risks propagating an + incorrect declaration. A ProxyHTMLCharsetOut + can remove that risk, but is likely to be a bigger processing + overhead than enabling ProxyHTMLMeta.

    +

    The other effect of enabling ProxyHTMLMeta is to parse all + <meta http-equiv=...> declarations and convert + them to real HTTP headers, in keeping with the original purpose + of this form of the HTML <meta> element.

    top
    @@ -273,6 +330,7 @@ This may be helpful in debugging a configuration.

    + @@ -302,7 +360,8 @@ module for earlier 2.x versions.

    This is the key directive for rewriting HTML links. When parsing a document, whenever a link target matches from-pattern, the matching portion will be rewritten to to-pattern, as modified by any -flags supplied.

    +flags supplied and by the ProxyHTMLExtended +directive.

    The optional third argument may define any of the following Flags. Flags are case-sensitive.

    @@ -364,12 +423,40 @@ Patterns supported are as above.

    +

    The optional fourth cond argument defines a condition +that will be evaluated per Request, provided +ProxyHTMLInterp is On. +If the condition evaluates FALSE the map will not be applied in this request. +If TRUE, or if no condition is defined, the map is applied.

    +

    A cond is evaluated by the Expression Parser. In addition, the simpler syntax of conditions +in mod_proxy_html 3.x for HTTPD 2.0 and 2.2 is also supported.

    Available Languages:  en 

    -
    +
    top

    Comments

    Notice:
    This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
    +
    \ No newline at end of file
    Description:Determines whether to strip HTML comments.
    Syntax:ProxyHTMLStripComments On|Off
    Default:ProxyHTMLStripComments Off
    Context:server config, virtual host, directory
    Status:Base
    Module:mod_proxy_html