Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 63816 invoked from network); 27 Jun 2006 10:06:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jun 2006 10:06:19 -0000 Received: (qmail 99729 invoked by uid 500); 27 Jun 2006 10:06:14 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 99647 invoked by uid 500); 27 Jun 2006 10:06:13 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 99635 invoked by uid 99); 27 Jun 2006 10:06:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2006 03:06:13 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 27 Jun 2006 03:06:13 -0700 Received: (qmail 63631 invoked by uid 2161); 27 Jun 2006 10:05:52 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by VISN0484.vodafone-is.de (Postfix) with ESMTP id 4B3CE3E72 for ; Tue, 27 Jun 2006 12:06:33 +0200 (CEST) Message-ID: <44A10328.7010601@apache.org> Date: Tue, 27 Jun 2006 12:06:32 +0200 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r417238 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_proxy_balancer.xml modules/proxy/mod_proxy_balancer.c References: <20060626165939.EF4CE1A983A@eris.apache.org> <44A016BF.9080902@apache.org> <44A01A81.7040006@apache.org> In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Brian Rectanus wrote: > On 6/26/06, Mladen Turk wrote: >> >> Thinking of it more deeply, the only valuable env var would >> be BALANCER_SESSION_ROUTE. >> All other parms are meaningless for the client unless >> you wish to create a loadbalancer as a cgi script. >> >> Regards, >> Mladen. >> >> > > I had two intentions with BALANCER_SESSION_ROUTE: > > 1) Provide a way for client to detect a server switch and possibly > cleanup (maybe remove the session cookie so next attempt would not > fail if server was gone and nofailover=On). Cleanup will be important > since these are session cookies and the server app has no way to > cleanup (it is down) and the user must restart his/her browser (remove > session cookie) to rebalance. > > RewriteRule "%{ENV:BALANCER_SESSION_ROUTE} > !="%{BALANCER_WORKER_ROUTE}" [E=REBALANCED:1] > Header add Set-Cookie "MYCOOKIE=; > path=/; expires=Monday, 01-Jan-1990 08:00:00 GMT > > " env=REBALANCED As far as I can see this also does not work, because these environment variables are set during the handler phase and thus are not available for rewrite rules. But I guess the patch can be used to setup the appropriate session routing inside of httpd if your backend does not support adding a route to the session cookie (this has been requested frequently): SetEnvIf ^Cookie$ MYCOOKIE HAVE_ROUTE Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=!HAVE_ROUTE ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On Of course this approach does not notice the client once you have switched your backend worker. Using Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On fixes this, but sets the cookie on every response which may not be what you want. Regards R�diger