Web developer said he will add more path to the header. He will adding
more /something. If I do use an irule and want to add both nodes to the pool and just pass the header intact that matches only the specified /path with a “else” statement that will point to the second node. Can you tell me the irule for that.
Its just incase I need it because I want do this first thing in the morning.
Ok can you send me a sample of the http class rule, I’m not to good with scripting.
Web developer said he will add more path to the header.
He will adding more /something. If I do use an irule and want to add both nodes to the pool and just pass the header intact that matches only the specified /path with a “else” statement that will point to the second node. Can you tell me the irule for that.
Its just incase I need it because I want do this first thing in the morning.
nitass is showing you how to do this with a switch statement, instead of “if” and using a data class to hold your URIs, instead of hard coding them into the iRule, which a lot better.
go under: Local Traffic ›› iRules : Data Group List ›› New Data Group…
Create a String group called uri_class, like in nitass example, put all your URIs there, as “String”, leave “Value” empty.
Create the iRule as in nitass example, just use “pool” instead of “node”
I still think you will better served by an HTTP class, instead of an iRule, given that you are not comfortable with scripting.
i agree with Mohamed. if you are not familiar with irule, you had better use httpclass.
sol13753: Using HTTP Classes to load balance HTTP requests to multiple pools
i used data group in previous example because i thought it would be easier to add or remove uri. anyway, if you do not want to use data group, you can use switch statement and put uri in the irule.
e.g.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/Akcelerant/*" -
"/IDSAkcelerant/*" -
"/LMAkcelerant/*" -
"/IDSAkcelerantMTG/*" {
pool Server1-pool
}
default {
pool Server2-pool
}
}
}
}