Content switching & cookies - problem with default_backend

From: James Little <james#loadbalancer.org>
Date: Thu, 11 Sep 2008 16:37:04 +0100


Hi,

I'm testing out a simple content switching config using ACLs as below:

frontend f1

	bind 192.168.2.112:80
	acl test_acl1 path_beg /test1
	acl test_acl2 path_beg /test2
	use_backend b1 if test_acl1
	use_backend b2 if test_acl2
	default_backend b2
	option httpclose

backend b1
	cookie	SERVERID insert nocache indirect
	server s1 192.168.2.99:80 weight 1 cookie s1 check
	server s2 192.168.2.10:80 weight 1 cookie s2 check

backend b2
	cookie	SERVERID insert nocache indirect
	server s3 192.168.2.6:80 weight 1 cookie s3 check



The problem is that the cookie from the default_backend (i.e. the cookie content = s3), seems to override any other cookie. So the cookie content is 's3' regardless of whether you are in the root, or / test1, /test2.

If I remove the default_backend option then the cookie insertion works as expected.

I am also wondering if there is a way to specify the cookie path, so that I could have two different cookies, one for /test1 and one for / test2?

Any help greatly appreciated.

-- 
Regards

James Little
www.loadbalancer.org
Received on 2008/09/11 17:37

This archive was generated by hypermail 2.2.0 : 2008/09/11 17:46 CEST