httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: [users@httpd] Load balancing based on header value
Date Wed, 30 Mar 2016 19:50:46 GMT
-----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
> 
> <Proxy balancer://cluster> BalancerMember ajp://myserver:8009
> route=node2 ProxySet lbmethod=bytraffic ProxySet
> stickysession=JSESSIONID </Proxy>
> 
> 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


Mime
View raw message