*) mod_cgi, mod_cgid: Fix use of CGI scripts as ErrorDocuments.
PR 39710. [Paul Querna, Ruediger Pluem]
+ *) mod_proxy: Allow to use different values for sessionid
+ in url encoded id and cookies. PR 41897. [Jean-Frederic Clere]
+
*) mod_proxy: Fix the 503 returned when session route does
not match any of the balancer members. [Mladen Turk]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_proxy: Allow to use different values for sessionid
- in url encoded id and cookies. (PR 41897)
- Trunk version of patch:
- http://svn.apache.org/viewvc?view=rev&rev=550519
- http://svn.apache.org/viewvc?view=rev&rev=551099
- http://svn.apache.org/viewvc?view=rev&rev=551126
- http://svn.apache.org/viewvc?view=rev&rev=551935
- http://svn.apache.org/viewvc?view=rev&rev=554892
- 2.2.x version of patch:
- http://issues.apache.org/bugzilla/attachment.cgi?id=20480
- +1: jfclere, mturk, rpluem
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
<td>Balancer sticky session name. The value is usually set to something
like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
and it depends on the backend application server that support sessions.
+ If the backend application server uses different name for cookies
+ and url encoded id (like servlet containers) use | to to separate them.
+ The first part is for the cookie the second for the path.
</td></tr>
<tr><td>timeout</td>
<td>0</td>
<p>A sample balancer setup</p>
<div class="example"><p><code>
ProxyPass /special-area http://special.example.com/ smax=5 max=10<br />
- ProxyPass / balancer://mycluster stickysession=jsessionid nofailover=On<br />
+ ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On<br />
<Proxy balancer://mycluster><br />
<span class="indent">
BalancerMember http://1.2.3.4:8009<br />
<td>Balancer sticky session name. The value is usually set to something
like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
and it depends on the backend application server that support sessions.
+ If the backend application server uses different name for cookies
+ and url encoded id (like servlet containers) use | to to separate them.
+ The first part is for the cookie the second for the path.
</td></tr>
<tr><td>timeout</td>
<td>0</td>
<p>A sample balancer setup</p>
<example>
ProxyPass /special-area http://special.example.com/ smax=5 max=10<br />
- ProxyPass / balancer://mycluster stickysession=jsessionid nofailover=On<br />
+ ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On<br />
<Proxy balancer://mycluster><br />
<indent>
BalancerMember http://1.2.3.4:8009<br />
static proxy_worker *find_session_route(proxy_balancer *balancer,
request_rec *r,
char **route,
+ char **sticky_used,
char **url)
{
proxy_worker *worker = NULL;
+ char *sticky, *sticky_path, *path;
if (!balancer->sticky)
return NULL;
+ sticky = sticky_path = apr_pstrdup(r->pool, balancer->sticky);
+ if ((path = strchr(sticky, '|'))) {
+ *path++ = '\0';
+ sticky_path = path;
+ }
+
/* Try to find the sticky route inside url */
- *route = get_path_param(r->pool, *url, balancer->sticky);
- if (!*route)
- *route = get_cookie_param(r, balancer->sticky);
+ *sticky_used = sticky_path;
+ *route = get_path_param(r->pool, *url, sticky_path);
+ if (!*route) {
+ *route = get_cookie_param(r, sticky);
+ *sticky_used = sticky;
+ }
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: BALANCER: Found value %s for "
"stickysession %s", *route, balancer->sticky);
int access_status;
proxy_worker *runtime;
char *route = NULL;
+ char *sticky = NULL;
apr_status_t rv;
*worker = NULL;
/* Step 2: find the session route */
- runtime = find_session_route(*balancer, r, &route, url);
+ runtime = find_session_route(*balancer, r, &route, &sticky, url);
/* Lock the LoadBalancer
* XXX: perhaps we need the process lock here
*/
access_status = rewrite_url(r, *worker, url);
/* Add the session route to request notes if present */
if (route) {
- apr_table_setn(r->notes, "session-sticky", (*balancer)->sticky);
+ apr_table_setn(r->notes, "session-sticky", 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);
+ "BALANCER_SESSION_STICKY", sticky);
apr_table_setn(r->subprocess_env,
"BALANCER_SESSION_ROUTE", route);
}