Forum Discussion
Albert__Tase_70
Nimbostratus
May 28, 2009trying to merge two seprate ruiles
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/dswsbobje"}{
persist uie [SSL::sessionid] 1500
pool biz-objects_209.34.86.25_7080
} elseif { [HTTP::uri] starts_with ...
spark_86682
Jun 02, 2009Historic F5 Account
You might be making this harder than it needs to be. You can simply associate two iRules with the same virtual.
If you still need to merge your iRules, then the problem you're running into is that you're mismatching your "when" statements. Syntacticly, you could do:
when RULE_INIT {
set ::key [AES::key 128]
}
when HTTP_REQUEST {
First rule
set encrypted [HTTP::cookie "secure_cookie"]
HTTP::cookie remove "secure_cookie"
set decrypted [AES::decrypt $::key [b64decode $encrypted]]
HTTP::cookie insert name "secure_cookie" value $decrypted
Second rule
if { [HTTP::uri] starts_with "/dswsbobje"}{
persist uie [SSL::sessionid] 1500
pool biz-objects_209.34.86.25_7080
} elseif { [HTTP::uri] starts_with "/biod"}{
persist uie [SSL::sessionid] 1500
pool na.crystalreports.com_biod_209.34.86.25_9080
} else {
pool biz_objects_209.34.86.25_8080
persist cookie insert
}
}
when HTTP_RESPONSE {
set decrypted [HTTP::cookie "secure_cookie"]
HTTP::cookie remove "secure_cookie"
set encrypted [b64encode [AES::encrypt $::key $decrypted]]
HTTP::header insert "Set-Cookie" "secure_cookie=$encrypted; Version=1; Secure; HttpOnly"
}
but that's just a syntatic merge. You should check the business logic to make sure it still does what you want.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
