Forum Discussion
nitass
Employee
can you try to set event priority and disable all after redirection?
priority
https://devcentral.f5.com/wiki/iRules.priority.ashxevent disable
https://devcentral.f5.com/wiki/iRules.event.ashxe.g.
// config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 63
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST priority 100 {
if { [HTTP::path] starts_with "/xyz" } {
HTTP::redirect "http://[HTTP::host]:40001/"
event disable all
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar40001
ltm virtual bar40001 {
destination 172.28.24.10:40001
ip-protocol tcp
mask 255.255.255.255
pool foo40001
profiles {
tcp { }
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 64
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo40001
ltm pool foo40001 {
members {
200.200.200.101:40001 {
address 200.200.200.101
}
}
}
// test
[root@ve11a:Active:In Sync] config curl -IL http://172.28.24.10/xyz/something
HTTP/1.0 302 Found
Location: http://172.28.24.10:40001/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
HTTP/1.1 200 OK
Date: Sat, 16 Aug 2014 08:24:04 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
ETag: "41879c-59-2a9c23c0"
Accept-Ranges: bytes
Content-Length: 89
Connection: close
Content-Type: text/html; charset=UTF-8
Thomas_Gobet
Aug 18, 2014Nimbostratus
Be careful on using contains, LyonsG was right.
You may prefere using starts_with instead of contains, you'll be sure that you won't have "false matches".