Forum Discussion

Yazid_Abdesslam's avatar
Yazid_Abdesslam
Icon for Nimbostratus rankNimbostratus
Jun 21, 2017

Apply Persistence Cookie on iRule (multi pool)

Hello,

We use the bellow iRule to LB to multiple pools depending on URI:

when HTTP_REQUEST {

set uri [string tolower [HTTP::uri]]

if { $uri starts_with "/content" } {
pool Pool_CRM81_Content_80

} elseif { $uri starts_with "/ecommunications_ccfra" } {
pool Pool_CRM81_ccfra

}
else {
drop
}

}

We'd Like to apply persistence cookie for Pool_CRM81_ccfra Only.

Trying to add command "persist cookie" failed,

can you give advices please?

Thank you in advance

  • Hello, you may try inverse logic, if possible. So, you keep default persistence to cookie on virtual server and disable it on the pool that not persistence needed. I prefer it because I often customize cookie persistence profiles.

    when HTTP_REQUEST {
        set uri [string tolower [HTTP::uri]]
        if { $uri starts_with "/content" } {
            pool Pool_CRM81_Content_80
        } elseif { $uri starts_with "/ecommunications_ccfra" } {
            pool Pool_CRM81_ccfra
            persist none
        }
        else {
            drop
        }
    }
    

    Just an idea!

    Regards