Forum Discussion
Cindy_127211
Nimbostratus
May 17, 2006Passing 'default pool' to rule
I have a default pool defined in a virtual server. The virtual server also has a rule that uses the default pool name. Right now, this pool name is hard coded. Is there any way to make a rule that uses the default pool name (from the virtual server) as a variable?
- Cindy_127211
Nimbostratus
Following is an example rule: - Al_Carandang_11
Nimbostratus
You can create a DataGroup (class) which looks like:
Your iRule will then look likeclass Pools { "vs_www_sbox_americancentury_com_PROXY acs80sbox" "virtual_server2 pool2" ... }
rule SSLV2_Encrypt_ACS_sbox { when HTTP_REQUEST { set mypool [findclass [virtual name] $::Pools " "] HTTP::header insert "Custom" "amc:443" if { ![matchclass [SSL::cipher version] equals $::CipherVersion] and [SSL::cipher bits] > 127 } { use pool $mypool } elseif { [HTTP::uri] starts_with "/encryptcode/" } { pool $mypool } else { HTTP::redirect https://[HTTP::host]/encryptcode/encryption_notice.jsp} } } }
- Cindy_127211
Nimbostratus
Wow! This worked great! Thank you so much for your quick reply. You have no idea how much time this will save me! - Al_Carandang_11
Nimbostratus
You're welcome. By the way, I had a typo in my earlier post so I had to edit it a bit. - Cindy_127211
Nimbostratus
Hi, I was just curious....I looked through your posting and believe that I typed it 'as is' and it worked just fine. What was the typo...in case I'm missing something that will come back up later? - Al_Carandang_11
Nimbostratus
You might have seen my reply after I fixed the typo. I had the code written as
when it should have been written as} elseif { [HTTP::uri] starts_with "/encryptcode/" } { pool $mypool } else {
} elseif { [HTTP::uri] starts_with "/encryptcode/" } { pool $mypool } else {
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