You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by G Quiggin <gj...@hotmail.com> on 2011/07/17 15:55:43 UTC
[users@httpd] mod_proxy_balancer config for HTTP header based sticky sessions
Hello there,
I'm trying to write a mod_proxy_balancer config to implemented sticky sessions between multiple backend tomcat instances with stickyness provided by an HTTP header.
eg 1st incoming request is processed by app and responds by setting a custom HTTP header with a value set at randon. All subsequent requests are processed by the same back end server.
So I'm trying to figure out a mod_proxy_balancer config which would support this, or which in general would support sticky sessions via a custom header that the application has set to a value.
Need apache proxy rules to forward incoming requests accompanied by an HTTP header to be sticky to one instance of the tomcat cluster.
ProxyPass /test balancer://test_cluster/test-app stickysession=%{HTTP:X-Test-Header}
<Proxy balancer://test_cluster>
BalancerMember http://giggle:8081 route= ???
BalancerMember http://giggle:8082 route= ???
BalancerMember http://giggle:8083 route= ???
BalancerMember http://giggle:8084 route= ???
</Proxy>
I'm sure I also need to use Header add Set-Cookie and BALANCER_SESSION_STICK and route set correctly within the config and perhaps a rewrite rule.
Thanks,
G J Quiggin
Re: [users@httpd] mod_proxy_balancer config for HTTP header based
sticky sessions
Posted by Jeroen Geilman <je...@adaptr.nl>.
On 2011-07-17 15:55, G Quiggin wrote:
> Hello there,
>
> I'm trying to write a mod_proxy_balancer config to implemented sticky
> sessions between multiple backend tomcat instances with stickyness
> provided by an HTTP header.
>
> eg 1st incoming request is processed by app and responds by setting a
> custom HTTP header with a value set at randon. All subsequent requests
> are processed by the same back end server.
>
> So I'm trying to figure out a mod_proxy_balancer config which would
> support this, or which in general would support sticky sessions via a
> custom header that the application has set to a value.
>
> Need apache proxy rules to forward incoming requests accompanied by an
> HTTP header to be sticky to one instance of the tomcat cluster.
>
> ProxyPass /test balancer://test_cluster/test-app
> stickysession=%{HTTP:X-Test-Header}
>
> <Proxy balancer://test_cluster>
> BalancerMember http://giggle:8081 route= ???
> BalancerMember http://giggle:8082 route= ???
> BalancerMember http://giggle:8083 route= ???
> BalancerMember http://giggle:8084 route= ???
> </Proxy>
>
> I'm sure I also need to use Header add Set-Cookie and
> BALANCER_SESSION_STICK and route set correctly within the config and
> perhaps a rewrite rule.
>
So... what exactly is your question ?
Which part of the mod_proxy_balancer documentation is unclear ?
> Thanks,
> G J Quiggin
>
--
J.