Forum Discussion
Tomasz_93254
Feb 18, 2011Nimbostratus
Irule strange problem
I have the following Irule on my LTM F5:
when HTTP_REQUEST {
set subpath [HTTP::uri]
if {[HTTP::host] equals "aaa.co.uk"} { HTTP::respond 301 Location "http://www.aaa.co.uk$subpath" }
elseif {[HTTP::host] contains "www.aaa.co.uk"} {use pool pl_it_www-aaa-co-uk_p80 }
elseif {[HTTP::host] contains "www.aaa.com"} {use pool pl_it_www-aaa-com_p80 }
elseif {[HTTP::host] equals "bbb.com"} { HTTP::respond 301 Location "http://www.bbb.com$subpath" }
elseif {[HTTP::host] equals "www.bbb.com" and [HTTP::uri] contains "/qqq"} { HTTP::respond 301 Location "http://www.bbb.com" }
elseif {[HTTP::host] equals "www.bbb.com" and [HTTP::uri] contains "/default.html"} { HTTP::respond 301 Location "http://www.bbb.com" }
elseif {[HTTP::host] contains "www.bbb.com"} {use pool pl_it_www-bbb-com_p80 }
}
The rule works fine but only if there is a default pool associated in virtual server configuration. If I change this Default Pool to None from the drop down, the Irule stops working. Any obvious reasons why it happens?
BRs
- hooleylistCirrostratusCan you try this? It's explicitly setting the pool or redirect for each case.
when CLIENT_ACCEPTED { Save the VS default pool name set default_pool [LB::server pool] } when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "aaa.co.uk" { HTTP::respond 301 Location "http://www.aaa.co.uk[HTTP::path]" } "www.aaa.co.uk" { pool pl_it_www-aaa-co-uk_p80 } "www.aaa.com" { pool pl_it_www-aaa-com_p80 } "bbb.com" { HTTP::respond 301 Location "http://www.bbb.com[HTTP::path]" } "www.bbb.com" { switch -glob [HTTP::path] { "*/qqq*" { HTTP::respond 301 Location "http://www.bbb.com" } "*/default.html" { HTTP::respond 301 Location "http://www.bbb.com" } default { pool pl_it_www-bbb-com_p80 } } } default { pool $default_pool } } }
- Tomasz_93254NimbostratusI have tried this and the script is not working either. NOnetheless I think I found the root of the problem.
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