bizooga
Nov 10, 2015Nimbostratus
Name Based Hosting iRule not working
Hi Folks,
My company hosts a bunch of sites on a single virtual server. Each website has its own pool and health monitor. I decided to use this irule to forward the request to the appropriate pool based on the host url.
when HTTP_REQUEST {
ABC-DG-Test is a string data-group where the entries are name:value pairs
name is the requested HTTP host header, value is the associated pool-name
check the requested HTTP host header against entries in data-group ABC-DG-Test
if { [class match [string tolower [HTTP::host]] equals ABC-DG-Test ] } {
if the HTTP host header is in ABC-DG-Test
send the request to the pool associated with the ABC-DG-Test entry
pool [class match -value [string tolower [HTTP::host]] equals ABC-DG-Test ]
} else {
drop the request if the host header is not in ABC-DG-Test
drop
event disable
}
}
The problem is that if the url that comes in is abc.com it will forward to the abc pool. If the url is abc.com/blah it will only display the page for abc.com and not abc.com/blah. The website shows correctly if you hit the web server node.
Any help or suggestions would be appreciated.
Thanks,
Kevin