Index: mod_proxy.c =================================================================== --- mod_proxy.c (revision 535579) +++ mod_proxy.c (working copy) @@ -274,11 +274,18 @@ int ival; if (!strcasecmp(key, "stickysession")) { + char *path; /* Balancer sticky session name. * Set to something like JSESSIONID or * PHPSESSIONID, etc.., */ - balancer->sticky = apr_pstrdup(p, val); + balancer->sticky = balancer->sticky_path = apr_pstrdup(p, val); + if ((path = strchr(balancer->sticky, '|'))) { + *path++ = '\0'; + balancer->sticky_path = path; + } + else + balancer->sticky_path = balancer->sticky; } else if (!strcasecmp(key, "nofailover")) { /* If set to 'on' the session will break Index: mod_proxy.h =================================================================== --- mod_proxy.h (revision 535579) +++ mod_proxy.h (working copy) @@ -354,6 +354,7 @@ apr_thread_mutex_t *mutex; /* Thread lock for updating lb params */ #endif void *context; /* general purpose storage */ + const char *sticky_path; /* URL sticky session identifier */ }; struct proxy_balancer_method { Index: mod_proxy_balancer.c =================================================================== --- mod_proxy_balancer.c (revision 535579) +++ mod_proxy_balancer.c (working copy) @@ -241,12 +241,19 @@ if (!balancer->sticky) return NULL; /* Try to find the sticky route inside url */ - *route = get_path_param(r->pool, *url, balancer->sticky); - if (!*route) + *route = get_path_param(r->pool, *url, balancer->sticky_path); + if (*route) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: BALANCER: Found value %s for " + "stickysession %s", *route, balancer->sticky_path); + } + else { *route = get_cookie_param(r, balancer->sticky); - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "proxy: BALANCER: Found value %s for " - "stickysession %s", *route, balancer->sticky); + if (*route) + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: BALANCER: Found value %s for " + "stickysession %s", *route, balancer->sticky); + } /* * If we found a value for sticksession, find the first '.' within. * Everything after '.' (if present) is our route.