Forum Discussion
Irule - Load Balance
Question on redirects and load balancing the redirect based on IP Address.
Is this possible? is my first question.
Here is an Example -
Existing site is
msoft.com/login/grumpy
New Site is going to be redirected and users would go to
microsoft.com/happydays
Is it possible to issue a redirect of the existing site and load balance it to it's new servers under microsoft.com/happydays
I have attempted to issue a redirect and load balance via an if/elseif statement however the data does not appear to go beyond the Http::respond -
ltm data-group datagroupvariable {
records {
/happydays {
data /login/grumpy
}
}
set variablewebsite [string tolower [HTTP::uri]]
if { ([class match $variablewebsite equals /datagroupvariable]) } {
HTTP::respond 301 location "https://[HTTP::host][class lookup $variablewebsite /datagroupvariable]"
} elseif { [class match [IP::client_addr] equals 192.168.1.0/24] } {
pool NewServerPool
} else {
reject
}
}
I can get a respond page, but while including the class match of client IP, I do not get a load balanced page. I get nothing instead.
Any Ideas?
2 Replies
- cjbarr1234
Altostratus
What I've done in the past on this is in order, put in the redirect, and then replace the host header with the new site. The problem that I had though, was redirect of two different site certificates since they did not share the same TLD. The irule to 302, redirect to the new VS, but then also at the end replace the host header with "new site".
Does that make sense?
- Vijay_E
Cirrus
if { ([class match $variablewebsite equals /datagroupvariable]) } {I see "/datagroupvariable" as the data group name. Is the "/" a typo ?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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