Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 203C6194A9 for ; Wed, 30 Mar 2016 19:51:23 +0000 (UTC) Received: (qmail 17914 invoked by uid 500); 30 Mar 2016 19:51:19 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 17876 invoked by uid 500); 30 Mar 2016 19:51:19 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 17866 invoked by uid 99); 30 Mar 2016 19:51:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 19:51:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 567F8C0741 for ; Wed, 30 Mar 2016 19:51:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.513 X-Spam-Level: * X-Spam-Status: No, score=1.513 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, NO_RDNS_DOTCOM_HELO=0.433, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id L8AtVWw2V1xV for ; Wed, 30 Mar 2016 19:51:17 +0000 (UTC) Received: from vms173009pub.verizon.net (vms173009pub.verizon.net [206.46.173.9]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D37E65FB50 for ; Wed, 30 Mar 2016 19:51:16 +0000 (UTC) Received: from vz-proxy-m001.mx.aol.com ([64.236.83.1]) by vms173009.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O4V00KENB4M6R50@vms173009.mailsrvcs.net> for users@httpd.apache.org; Wed, 30 Mar 2016 14:50:51 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=J+9Xl1TS c=1 sm=1 tr=0 a=IfeYs1eZmZ/JIJO4DN4ZPw==:117 a=IkcTkHD0fZMA:10 a=7OsogOcEt9IA:10 a=mV9VRH-2AAAA:8 a=j4nzMFrpAAAA:8 a=QfKxxUxMAAAA:8 a=4kBmFzN5rSgNfPUnZRoA:9 a=QEXdDO2ut3YA:10 Received: by 71.127.40.115 with SMTP id 38b68db1; Wed, 30 Mar 2016 19:50:51 GMT To: users@httpd.apache.org References: <56FC17DC.6040407@gmail.com> <56FC1FED.1070308@christopherschultz.net> <56FC22B2.5080907@gmail.com> From: Christopher Schultz Message-id: <56FC2E16.6070707@christopherschultz.net> Date: Wed, 30 Mar 2016 15:50:46 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-version: 1.0 In-reply-to: <56FC22B2.5080907@gmail.com> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8bit Subject: Re: [users@httpd] Load balancing based on header value -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Niranjan, On 3/30/16 3:02 PM, Niranjan Rao wrote: > I am using AJP to connect to tomcat. > > Entry in the config file looks like > > BalancerMember ajp://myserver:8009 > route=node2 ProxySet lbmethod=bytraffic ProxySet > stickysession=JSESSIONID > > Hope this answers your question. Okay, so you are using mod_proxy_ajp. I'm not sure how to do it in mod_proxy_ajp, but mod_jk allows the request to override the worker to be used. I believe if you set the JK_WORKER_NAME environment variable (for mod_jk only) that worker name will be used. You can use whatever means in httpd to set that variable such as mod_rewrite, etc. I would imagine that there is a similar facility in mod_proxy_ajp. - -chris > On 3/30/16 2:15 PM, Niranjan Rao wrote: >>>> Greetings, >>>> >>>> My first post to this mailing list. >>>> >>>> I have apache2 load balancing working perfectly based on >>>> session affinity. Traffic does get directed properly to >>>> appropriate tomcat server. >>>> >>>> We are trying to use same servers to serve some REST API >>>> calls. These calls don't have a session, however tomcat >>>> honouring the request does maintain some state and we would >>>> like to redirect the traffic to same tomcat based on some >>>> header value. >>>> >>>> Tried searching and reading documents from apache web site, >>>> but have not figured it out yet. >>>> >>>> Can I load balance based on header value? It seems to be >>>> doable, but could not find any example or how-to. > Which module are you using to proxy httpd -> Tomcat? > > -chris >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org >> For additional commands, e-mail: users-help@httpd.apache.org >> > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlb8LhYACgkQ9CaO5/Lv0PAA1ACcC9BuizMCiIORYNyCgeQ9Vt+5 CeMAn3qo01HeRt9VRbKBVy1QXZrEL6y/ =ffky -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org