At present there are 5 environment variables exported:
+ + +This is assigned the stickysession value used in the current + request. It is the cookie or parameter name used for sticky sessions
+This is assigned the route parsed from the current + request.
+This is assigned the name of the balancer used for the current
+ request. The value is something like balancer://foo
.
This is assigned the name of the worker used for the current request.
+ The value is something like http://hostA:1234
.
This is assigned the route of the worker that will be + used for the current request.
+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",