did you get anywhere with this?

you can check the HTTP_COOKIE var in a rewritecond, so something like:

RewriteCond %{HTTP_COOKIE} !BALANCEID=

should stop processing if there is already a BALANCEID cookie set.

On 07/05/2011 11:34 PM, Carlos Konstanski wrote:
> I'm having an issue with apache's mod_proxy_balancer. I need to set a cookie
> in the form <something>.<routeid>. Using RewriteRule to do it. It's writing
> the cookie fine, but it keeps REWRITING it upon every request
> unconditionally with a new Set-Cookie. I think I need a RewriteCond to check
> for the existence of the cookie first. Can someone help me understand how to
> write the condition? Struggling with the docs.
>
> Below is my entire balancer config.
>
> Thanks,
>
> Carlos
>
> <VirtualHost *:80>
>     ServerName dc.pippiandcarlos.com
>     ServerAdmin [email protected]
>     ProxyPass / balancer://dc.pippiandcarlos.com.cluster/
> stickysession=BALANCEID
>     SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
> </VirtualHost>
>
> <Proxy balancer://dc.pippiandcarlos.com.cluster>
>     BalancerMember http://dc1.pippiandcarlos.com/ route=dc1
>     BalancerMember http://dc2.pippiandcarlos.com/ route=dc2
> </Proxy>
>
> <VirtualHost *:80>
>     ServerName dc1.pippiandcarlos.com
>     ServerAdmin [email protected]
>     ProxyPass / http://dc1.pippiandcarlos.com:3001/
>     ProxyPassReverse / http://dc1.pippiandcarlos.com:3001/
>     RewriteEngine On
>     RewriteRule .* - [CO=BALANCEID:balancer.dc1:.pippiandcarlos.com]
>     SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerName dc2.pippiandcarlos.com
>     ServerAdmin [email protected]
>     ProxyPass / http://dc2.pippiandcarlos.com:3002/
>     ProxyPassReverse / http://dc2.pippiandcarlos.com:3002/
>     RewriteEngine On
>     RewriteRule .* - [CO=BALANCEID:balancer.dc2:.pippiandcarlos.com]
>     SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
> </VirtualHost>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to