From 3d3827eb59bc3b6eb33c4b10683c638c569a11ae Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 5 Oct 2010 21:06:52 +0000 Subject: [PATCH] Update transformations. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1004814 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_proxy.html.en | 161 +++++++++++++++++-- docs/manual/mod/mod_proxy.xml.ja | 2 +- docs/manual/mod/mod_proxy_balancer.html.en | 178 ++++++++++++++++++--- docs/manual/mod/mod_proxy_balancer.xml.ja | 2 +- 4 files changed, 303 insertions(+), 40 deletions(-) diff --git a/docs/manual/mod/mod_proxy.html.en b/docs/manual/mod/mod_proxy.html.en index e1adcb7ef96..62a91c6a74b 100644 --- a/docs/manual/mod/mod_proxy.html.en +++ b/docs/manual/mod/mod_proxy.html.en @@ -95,6 +95,7 @@
  • Forward Proxies and Reverse Proxies/Gateways
  • Basic Examples
  • +
  • Workers
  • Controlling access to your proxy
  • Slow Startup
  • Intranet Proxy
  • @@ -168,6 +169,11 @@

    In addition, if you wish to have caching enabled, consult the documentation from mod_cache.

    +

    Reverse Proxy

    + ProxyPass /foo http://foo.example.com/bar
    + ProxyPassReverse /foo http://foo.example.com/bar +

    +

    Forward Proxy

    ProxyRequests On
    ProxyVia On
    @@ -181,19 +187,122 @@ </Proxy>

    -

    Reverse Proxy

    - ProxyRequests Off
    -
    - <Proxy *>
    - - Order deny,allow
    - Allow from all
    -
    - </Proxy>
    -
    - ProxyPass /foo http://foo.example.com/bar
    - ProxyPassReverse /foo http://foo.example.com/bar -

    +
    top
    +
    +

    Workers

    +

    The proxy manages the configuration of origin servers and their + communication parameters in objects called workers. + There are two built-in workers, the default forward proxy worker and the + default reverse proxy worker. Additional workers can be configured + explicitly.

    + +

    The two default workers have a fixed configuration + and will be used if no other worker matches the request. + They do not use HTTP Keep-Alive or connection pooling. + The TCP connections to the origin server will instead be + opened and closed for each request.

    + +

    Explicitly configured workers are identified by their URL. + They are usually created and configured using + ProxyPass or + ProxyPassMatch when used + for a reverse proxy:

    + +

    + ProxyPass /example http://backend.example.com connectiontimeout=5 timeout=30 +

    + +

    This will create a worker associated with the origin server URL + http://backend.example.com and using the given timeout + values. When used in a forward proxy, workers are usually defined + via the ProxySet directive:

    + +

    + ProxySet http://backend.example.com connectiontimeout=5 timeout=30 +

    + +

    or alternatively using Proxy + and ProxySet:

    + +

    + <Proxy http://backend.example.com>
    + + ProxySet connectiontimeout=5 timeout=30 + + </Proxy> +

    + +

    Using explicitly configured workers in the forward mode is + not very common, because forward proxies usually communicate with many + different origin servers. Creating explicit workers for some of the + origin servers can still be useful, if they are used very often. + Explicitly configured workers have no concept of forward or reverse + proxying by themselves. They encapsulate a common concept of + communication with origin servers. A worker created by + ProxyPass for use in a + reverse proxy will be also used for forward proxy requests whenever + the URL to the origin server matches the worker URL and vice versa.

    + +

    The URL identifying a direct worker is the URL of its + origin server including any path components given:

    + +

    + ProxyPass /examples http://backend.example.com/examples
    + ProxyPass /docs http://backend.example.com/docs +

    + +

    This example defines two different workers, each using a separate + connection pool and configuration.

    + +

    Worker Sharing

    +

    Worker sharing happens if the worker URLs overlap, which occurs when + the URL of some worker is a leading substring of the URL of another + worker defined later in the configuration file. In the following example

    + +

    + ProxyPass /apps http://backend.example.com/ timeout=60
    + ProxyPass /examples http://backend.example.com/examples timeout=10 +

    + +

    the second worker isn't actually created. Instead the first + worker is used. The benefit is, that there is only one connection pool, + so connections are more often reused. Note that all configuration attributes + given explicitly for the later worker and some configuration defaults will + overwrite the configuration given for the first worker. This will be logged + as a warning. In the above example the resulting timeout value + for the URL /apps will be 10 instead + of 60!

    + +

    If you want to avoid worker sharing, sort your worker definitions + by URL length, starting with the longest worker URLs. If you want to maximize + worker sharing use the reverse sort order. See also the related warning about + ordering ProxyPass directives.

    + +
    + +

    Explicitly configured workers come in two flavors: + direct workers and (load) balancer workers. + They support many important configuration attributes which are + described below in the ProxyPass + directive. The same attributes can also be set using + ProxySet.

    + +

    The set of options available for a direct worker + depends on the protocol, which is specified in the origin server URL. + Available protocols include ajp, + ftp, http and scgi.

    + +

    Balancer workers are virtual workers that use direct workers known + as their members to actually handle the requests. Each balancer can + have multiple members. When it handles a request, it chooses a member + based on the configured load balancing algorithm.

    + +

    A balancer worker is created if its worker URL uses + balancer as the protocol scheme. + The balancer URL uniquely identifies the balancer worker. + Members are added to a balancer using + BalancerMember.

    +
    top

    Controlling access to your proxy

    @@ -534,6 +643,10 @@ directly

    +

    See also

    +
    top

    ProxyBadHeader Directive

    @@ -698,6 +811,10 @@ proxied resources identical to the <Proxy> directive, except it matches URLs using regular expressions.

    +

    See also

    +
    top

    ProxyMaxForwards Directive

    @@ -783,10 +900,20 @@ through backend.example.com except requests made to /mirror/foo/i.

    -

    Note

    -

    Order is important: exclusions must come before the - general ProxyPass directive.

    -
    +

    Ordering ProxyPass Directives

    +

    The configured ProxyPass + and ProxyPassMatch + rules are checked in the order of configuration. The first rule that + matches wins. So usually you should sort conflicting + ProxyPass rules starting with the + longest URLs first. Otherwise later rules for longer URLS will be hidden + by any earlier rule which uses a leading substring of the URL. Note that + there is some relation with worker sharing.

    + +

    For the same reasons exclusions must come before the + general ProxyPass directives.

    + +

    As of Apache 2.1, the ability to use pooled connections to a backend server is available. Using the key=value parameters it is diff --git a/docs/manual/mod/mod_proxy.xml.ja b/docs/manual/mod/mod_proxy.xml.ja index 819b687e4ae..df0dd906b74 100644 --- a/docs/manual/mod/mod_proxy.xml.ja +++ b/docs/manual/mod/mod_proxy.xml.ja @@ -1,7 +1,7 @@ - + +