Forum Discussion
mo_99289
Feb 02, 2016Historic F5 Account
hope this could help
when HTTP_REQUEST {
log local0. "Host is [string tolower [HTTP::host]]"
switch -regexp [string tolower [HTTP::host]] {
.*\.a.com {
log local0. "*.a.com"
}
.*\.b.com {
log local0. "*.b.com"
}
default {
log local0. "default domain"
}
}
simple test:
for host in web.a.com web.b.com web.c.coom; do curl -o /dev/null -H "Host: $host" http://10.2.22.183/; done
ltm log:
Feb 2 17:28:00 ve3 info tmm1[32273]: Rule /Common/irule_http_request : Host is web.a.com
Feb 2 17:28:00 ve3 info tmm1[32273]: Rule /Common/irule_http_request : *.a.com
Feb 2 17:28:00 ve3 info tmm[32273]: Rule /Common/irule_http_request : Host is web.b.com
Feb 2 17:28:00 ve3 info tmm[32273]: Rule /Common/irule_http_request : *.b.com
Feb 2 17:28:00 ve3 info tmm1[32273]: Rule /Common/irule_http_request : Host is web.c.coom
Feb 2 17:28:00 ve3 info tmm1[32273]: Rule /Common/irule_http_request : default domain