From 736ff9c9e37dac28145030b495995f92a4448ee8 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Wed, 9 Nov 2011 00:00:20 +0000 Subject: [PATCH] Applies patch provided by Luke Meyer in https://issues.apache.org/bugzilla/show_bug.cgi?id=51131 - Adds usage example to mod_proxy_ajp docs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199554 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_proxy_ajp.html.en | 41 +++++++++++++++++++++++++++ docs/manual/mod/mod_proxy_ajp.xml | 40 ++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/docs/manual/mod/mod_proxy_ajp.html.en b/docs/manual/mod/mod_proxy_ajp.html.en index 9f37034070..49791d315f 100644 --- a/docs/manual/mod/mod_proxy_ajp.html.en +++ b/docs/manual/mod/mod_proxy_ajp.html.en @@ -51,6 +51,7 @@ directives.

Topics

top
+

Usage

+

This module is used to reverse proxy to a backend application server + (e.g. Apache Tomcat) using the AJP13 protocol. The usage is similar to + an HTTP reverse proxy, but uses the ajp:// prefix: + +

Simple Reverse Proxy

+ ProxyPass /app ajp://backend.example.com:8009/app +

+ + Balancers may also be used: +

Balancer Reverse Proxy

+ <Proxy balancer://cluster>
+ + BalancerMember ajp://app1.example.com:8009 loadfactor=1
+ BalancerMember ajp://app2.example.com:8009 loadfactor=2
+ ProxySet lbmethod=bytraffic
+
+ </Proxy>
+ ProxyPass /app balancer://cluster/app +

+

+ Note that usually no + ProxyPassReverse + directive is necessary. The AJP request includes the original host + header given to the proxy, and the application server can be expected + to generate self-referential headers relative to this host, so no + rewriting is necessary. +

+ The main exception is when the URL path on the proxy differs from that on the + backend. In this case, a redirect header can be rewritten relative to the + original host URL (not the backend ajp:// URL), for example: +

Rewriting Proxied Path

+ ProxyPass /apps/foo ajp://backend.example.com:8009/foo
+ ProxyPassReverse /apps/foo http://www.example.com/foo +

+ However, it is usually better to deploy the application on the backend + server at the same path as the proxy rather than to take this approach. +

+
top
+

Environment Variables

Environment variables whose names have the prefix AJP_ are forwarded to the origin server as AJP request attributes diff --git a/docs/manual/mod/mod_proxy_ajp.xml b/docs/manual/mod/mod_proxy_ajp.xml index 8a9db925bc..c501ad2b5f 100644 --- a/docs/manual/mod/mod_proxy_ajp.xml +++ b/docs/manual/mod/mod_proxy_ajp.xml @@ -51,6 +51,46 @@ mod_proxy Environment Variable documentation +

Usage +

This module is used to reverse proxy to a backend application server + (e.g. Apache Tomcat) using the AJP13 protocol. The usage is similar to + an HTTP reverse proxy, but uses the ajp:// prefix: + + Simple Reverse Proxy + ProxyPass /app ajp://backend.example.com:8009/app + + + Balancers may also be used: + Balancer Reverse Proxy + <Proxy balancer://cluster>
+ + BalancerMember ajp://app1.example.com:8009 loadfactor=1
+ BalancerMember ajp://app2.example.com:8009 loadfactor=2
+ ProxySet lbmethod=bytraffic
+
+ </Proxy>
+ ProxyPass /app balancer://cluster/app +
+

+ Note that usually no + ProxyPassReverse + directive is necessary. The AJP request includes the original host + header given to the proxy, and the application server can be expected + to generate self-referential headers relative to this host, so no + rewriting is necessary. +

+ The main exception is when the URL path on the proxy differs from that on the + backend. In this case, a redirect header can be rewritten relative to the + original host URL (not the backend ajp:// URL), for example: + Rewriting Proxied Path + ProxyPass /apps/foo ajp://backend.example.com:8009/foo
+ ProxyPassReverse /apps/foo http://www.example.com/foo +
+ However, it is usually better to deploy the application on the backend + server at the same path as the proxy rather than to take this approach. +

+
+
Environment Variables

Environment variables whose names have the prefix AJP_ are forwarded to the origin server as AJP request attributes -- 2.40.0