Forum Discussion

Gus_Thompson_11's avatar
Gus_Thompson_11
Icon for Nimbostratus rankNimbostratus
Oct 29, 2007

Cookie Persistence iRule help

Greetings,

 

 

I’m in desperate need of a solution for “Cookie Insert” persistence. I have worked with F5 support for over a month now, and still have not been able to resolve our issues. So, I’m reaching out to the true experts to see if iRules can do what we need. I’m very new to iRules, so please be as detailed as possible.

 

 

First let me explain the layout:

 

 

We have 4 Apache/Linux web servers that are load balanced behind a pair of active / active F5 BIG-IP 9.1.2 Build 40.2 Load Balancers.

 

We have created a pool (ST-AWtestsite-173) listening on all ports (*).

 

We have created a virtual server (ST-http-AWtestsite-173) listening for HTTP (port 80)

 

We have created a virtual server (ST-https-AWtestsite-173) listening for HTTPS (port 443)

 

We are using a single arm configuration for the F5.

 

F5-1 = 172.26.30.240

 

F5-2 = 172.26.30.241

 

www1 = 172.26.30.1

 

www2 = 172.26.30.2

 

www3 = 172.26.30.3

 

www4 = 172.26.30.4

 

Note: the webservers listen on port 80 and 443

 

We are using the default http profile.

 

We tried using Cookie Insert as our default persistence profile and Source Address Affinity as our fall back persistence profile.

 

 

We are not able to maintain persistence using these settings when a client goes from HTTP to HTTPS. F5 Support has told us that cookie insert does not allow for “match across services”, “match across virtual servers”, and “match across pools”. We also tried cookie hash, but that fails at times when the servers redirect the clients using 302 redirects.

 

 

If by using a Universal Persistence profile and an iRule, could we maintain persistence across services and virtual servers? We need to be sticky to the same web server for HTTP and HTTPS. If so, how would I build the iRule to insert a cookie and maintain persistence based on that cookie?

 

 

As an FYI, using source address affinity as the main persistence profile works for us, but does not work when multiple clients originate from the same source address (proxied client). Using cookie insert works great for that scenario but fails when switching services.

 

 

Thanks in advanced for your help,

 

Gus

 

11 Replies