Forum Discussion
Single Virtual IP, single pool, 2 members
I fixed problem.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "cg.company.local" and [HTTP::path] ne "/SVFE2/" and [HTTP::path] eq "/" } {
HTTP::respond 301 Location "https://cg.company.local/SVFE2/"
node "10.200.5.14:7007"
}
elseif { [string tolower [HTTP::host]] eq "sg.company.local" and [HTTP::path] ne "/sv/" and [HTTP::path] eq "/" } {
HTTP::respond 301 Location "https://sg.company.local/sv/"
node "10.200.5.14:7005"
}
}
Hi,
"Node command" works if uri equals "/", for your rule.
Use this iRule if you want to redirect all hostname based requests to node.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "cg.company.local" } {
if { [HTTP::uri] equals "/" } {
HTTP::respond 301 Location "https://[HTTP::host]/SVFE2/"
}
node "10.200.5.14:7007"
}
elseif { [string tolower [HTTP::host]] equals "sg.company.local" } {
if { [HTTP::uri] equals "/" } {
HTTP::respond 301 Location "https://[HTTP::host]/sv/"
}
node "10.200.5.14:7005"
}
}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
