Forum Discussion
irule to redirect traffic to pool for two url
Hope its URL. Check it out
when HTTP_REQUEST {
if { (string tolower [HTTP::host] equals "www.xyz.com") or (string tolower [HTTP::host] equals "www.pqr.com") } {
pool pool_common_ABC
}
}
- mike03_367540Aug 08, 2018
Nimbostratus
Thanks for quick response can we add else command and rest of traffic should be
rejected when HTTP_REQUEST { if { [string tolower [HTTP::host] equals ";] or [string tolower [HTTP::host] equals ";] } { pool pool_common_ABC } else { reject } } - Samir_Jha_52506Aug 08, 2018
Noctilucent
Yes. we can use.
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "www.xyz.com") or ([string tolower [HTTP::host]] equals "www.pqr.com") } { pool pool_common_ABC } else { reject } } - mike03_367540Aug 10, 2018
Nimbostratus
error: [invalid index: should be integer or "end"][equals] - mike03_367540Aug 10, 2018
Nimbostratus
giving an error
- mike03_367540Aug 10, 2018
Nimbostratus
works like that
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" or [string tolower [HTTP::host]] equals "xyz.com"} { pool pool_abc } else {
reject } } - Samir_Jha_52506Aug 10, 2018
Noctilucent
I don't see issue in previous, it seems
missed. Correct it.... Check now] - mike03_367540Aug 10, 2018
Nimbostratus
Thanks Samir How can we use HTTP request for Data Group ..instead of url ..if I can make data group with all the url so how can i write the irule
- Samir_Jha_52506Aug 10, 2018
Noctilucent
something like this, you can use.
class redirecthost { www.abc.com www.pqr.com www.xyz.com } when HTTP_REQUEST { if { [matchclass [string tolower [HTTP::host]] equals redirecthost] } { pool pool_A } else { reject } } - mike03_367540Aug 10, 2018
Nimbostratus
working great Thanks,
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
