Forum Discussion
a_pavlov_114144
Apr 10, 2014Cirrus
You should assign something like the following iRule to your virtual server:
when HTTP_REQUEST {
if { [HTTP::uri] contains "services" } {
HTTP::redirect "/wps/portal"
pool SERVICE_POOL
}
elseif { [HTTP::uri] contains "oservices" } {
HTTP::redirect "/wps/portal"
pool OSERVICE_POOL
}
}
- NewTOF501_15047Apr 10, 2014NimbostratusThanks. I tried but it is sending traffic to default pool not to member of service_pool
- a_pavlov_114144Apr 10, 2014CirrusYou can add some logging to your irule to make sure that conditions in if statement work fine. And then look in /var/log/ltm for your messages. Like this: when HTTP_REQUEST { log local0. "URI = [HTTP::uri]" if { [HTTP::uri] contains "services" } { HTTP::redirect "/wps/portal" pool SERVICE_POOL log local0. "SERVICE POOL" } elseif { [HTTP::uri] contains "oservices" } { HTTP::redirect "/wps/portal" pool OSERVICE_POOL log local0. "OSERVICE_POOL" } }
- NewTOF501_15047Apr 10, 2014NimbostratusI added log local0 but nothing appearing in /var/log/ltm
- a_pavlov_114144Apr 10, 2014CirrusEven the string with URI? log local0. "URI = [HTTP::uri]" - this should work on every HTTP Request. Are you sure you have assigned this iRule to virtual server?
- NewTOF501_15047Apr 10, 2014Nimbostratussorry i found log it says below. why request /wps/portal is not going to member of SERVICE POOL Apr 10 11:26:01 CIODCDMZF5LTM02 info tmm2[10306]: Rule /Common/services.portal : URI = /services Apr 10 11:26:01 CIODCDMZF5LTM02 info tmm2[10306]: Rule /Common/services.portal : SERVICE POOL Apr 10 11:26:01 CIODCDMZF5LTM02 info tmm2[10306]: Rule /Common/services.portal : URI = /wps/portal
- a_pavlov_114144Apr 10, 2014CirrusI see. The problem is that we shouldn't use redirect here. Then iRule should be the following: when HTTP_REQUEST { log local0. "URI = [HTTP::uri]" if { [HTTP::uri] contains "services" } { HTTP::uri "/wps/portal" pool SERVICE_POOL log local0. "SERVICE POOL" } elseif { [HTTP::uri] contains "oservices" } { HTTP::uri "/wps/portal" pool OSERVICE_POOL log local0. "OSERVICE_POOL" } }
- NewTOF501_15047Apr 10, 2014NimbostratusThanks but still same problem Apr 10 11:41:56 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : URI = /services Apr 10 11:41:56 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : tstsrv_Pool_http Apr 10 11:41:56 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : URI = /wps/portal/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOItLNydDY0sjLzcTcOMDBxNLE0sLcNMjQwMTIEKIoEKDHAARwNC-sP1o8BKnN0dPUzMfYB6TCyMDDxdnDxczC19DQw8zaAK8FhRkBthkOmoqAgAqk60hg!!/dl5/d5/L2dBISEvZ0FBIS9nQSEh/
- a_pavlov_114144Apr 10, 2014CirrusHm, this is strange. Try this one, let's see what's going wrong: when HTTP_REQUEST { log local0. "URI = [HTTP::uri]" if { [HTTP::uri] contains "services" } { log local0. "URI CONTAINS SERVICES" HTTP::uri "/wps/portal" pool SERVICE_POOL log local0. "SERVICE POOL" } elseif { [HTTP::uri] contains "oservices" } { log local0. "URI CONTAINS OSERVICES" HTTP::uri "/wps/portal" pool OSERVICE_POOL log local0. "OSERVICE_POOL" } else { log local0. "DEFAULT POOL" } }
- NewTOF501_15047Apr 10, 2014NimbostratusThanks again after change below are log Apr 10 12:41:39 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : URI = /services Apr 10 12:41:39 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : URI CONTAINS SERVICES Apr 10 12:41:39 CIODCDMZF5LTM02 info tmm7[10306]: Rule /Common/services.portal : SERVICE POOL
- a_pavlov_114144Apr 10, 2014CirrusSo, I suppose it should work. Is it not?