Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Cookie Persist with iRule enforced pool member selection

Hi,

Setup:

Virtual server has a default pool configured.

RR is the LB method.

Cookie persistence is enabled.

Oneconnect profile is enabled.

Requirement:

When Client initiates its first HTTP request, pool member should be selected based on specific info in the HTTP URI, instead of the normal LB selection process. Ex, 'pool (Pool Name) member (IP) (Port)'. The specific Info in URI which helps in above pool member selection is only available in the first HTTP request.

LTM is not inserting appropriate HTTP cookie in the response for the first request, when member selection is done with the following command Ex, 'pool (Pool Name) member (IP) (Port)' . As a result persistence fails for subsequent requests from the client.

Is there any way to address it other than going for custom persistence ?

Does any one have an iRule to encode the selected member <ip:80> in to the normal cookie format <xxxxxxxxx.xxxxx.0000> , so that this cookie can be inserted using iRules on HTTP Response?

Thanks.

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

If your goal is just to persist based on a HTTP header information (like cookie) that is decided based on the 1st HTTP request, you can do something like this:

when HTTP_REQUEST {
if { ([HTTP::header header SERVER] ne "") } {

<USE Switch to send traffic to the appropriate server>

} else {

<USE Switch statement to identify the server based on HTTP::uri>
            { HTTP::header insert SERVER <Server-Name>
              pool POOL_WEB member 10.10.10.10 80 }
} 

For cookie encoding related coding, see this link and this link.

0
Comments on this Answer
Comment made 25-Aug-2016 by Saran 57

Thank You Odaah...

0