Ben_Conrad_1026
Apr 05, 2006Nimbostratus
Simple iRule not working
Hi folks,
I am having a problem with a simple iRule, I am trying to do the following:
- mypool1 = www.company.com, has 1 node, virt. server is myvs1
- mypool2 = mystring.company.com, has 1 node, virt. server is myvs2
When a client requests http://www.company.com/mystring I want the clients base url to stay at www.company.com but the data will come from the nodes in the mypool2 servers.
when HTTP_REQUEST {
if { [HTTP::uri] contains "mystring" } {
pool mypool2
}
}
Initially, when I created this iRule the ltm complained with:
01070394:3: HTTP_REQUEST event in rule (myRule1)
requires an associated HTTP or FASTHTTP profile
on the virtual server (myvs1).
So I went into the myvs1 (and myvs2) virtual servers and changed the http profile to "http", this resolvd the error message however when I point a newly opened IE browser to www.company.com/mystring I get a 404 error. The interesting thing is that if I use the following iRule the uri string matches and I'm redirected to www.google.com:
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri contains "mystring" } {
HTTP::redirect "http://www.google.com/"
}
}
Can somebody tell me what I'm missing in this setup?
Thanks,
Ben