diff -ru trunk.orig/docs/manual/mod/mod_proxy_balancer.xml trunk/docs/manual/mod/mod_proxy_balancer.xml --- trunk.orig/docs/manual/mod/mod_proxy_balancer.xml 2006-06-14 13:51:57.000000000 -0400 +++ trunk/docs/manual/mod/mod_proxy_balancer.xml 2006-06-14 15:16:35.000000000 -0400 @@ -271,6 +271,47 @@ +
+ Exported Environment Variables +

At present there are 5 environment variables exported:

+ + +
BALANCER_SESSION_STICKY
+
+

This is assigned the stickysession value used in the current + request. It is the cookie or parameter name used for sticky sessions

+
+ + +
BALANCER_SESSION_ROUTE
+
+

This is assigned the route parsed from the current + request.

+
+ + +
BALANCER_NAME
+
+

This is assigned the name of the balancer used for the current + request. The value is something like balancer://foo.

+
+ + +
BALANCER_WORKER_NAME
+
+

This is assigned the name of the worker used for the current request. + The value is something like http://hostA:1234.

+
+ + +
BALANCER_WORKER_ROUTE
+
+

This is assigned the route of the worker that will be + used for the current request.

+
+ +
+
Enabling Balancer Manager Support

This module requires the service of diff -ru trunk.orig/modules/proxy/mod_proxy_balancer.c trunk/modules/proxy/mod_proxy_balancer.c --- trunk.orig/modules/proxy/mod_proxy_balancer.c 2006-06-14 13:52:23.000000000 -0400 +++ trunk/modules/proxy/mod_proxy_balancer.c 2006-06-14 15:10:33.000000000 -0400 @@ -389,6 +389,14 @@ *worker = runtime; } + /* Add balancer/worker info to env. */ + apr_table_setn(r->subprocess_env, + "BALANCER_NAME", (*balancer)->name); + apr_table_setn(r->subprocess_env, + "BALANCER_WORKER_NAME", (*worker)->name); + apr_table_setn(r->subprocess_env, + "BALANCER_WORKER_ROUTE", (*worker)->s->route); + /* Rewrite the url from 'balancer://url' * to the 'worker_scheme://worker_hostname[:worker_port]/url' * This replaces the balancers fictional name with the @@ -399,6 +407,12 @@ if (route) { apr_table_setn(r->notes, "session-sticky", (*balancer)->sticky); apr_table_setn(r->notes, "session-route", route); + + /* Add session info to env. */ + apr_table_setn(r->subprocess_env, + "BALANCER_SESSION_STICKY", (*balancer)->sticky); + apr_table_setn(r->subprocess_env, + "BALANCER_SESSION_ROUTE", route); } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: BALANCER (%s) worker (%s) rewritten to %s",