Forum Discussion
35 Replies
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_15047NimbostratusThanks. I tried but it is sending traffic to default pool not to member of service_pool
- You 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_15047NimbostratusI added log local0 but nothing appearing in /var/log/ltm
- eddy99_235215Nimbostratus
Hi I am new to iRule, i have this irule redirecting http trafic to WWW_Maximo_pool:
when HTTP_REQUEST { if { [HTTP::uri] contains "MAXPROD" } { pool WWW_Maximo_pool } else { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
i want it to do the same redirect for HTTPS trafic, so i did the follwoing modification:
when HTTP_REQUEST or HTTPS_REQUEST { if { [HTTP::uri] contains "MAXPROD" } or { [HTTPS::uri] contains "MAXPROD" } { pool WWW_Maximo_pool } else { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
but that gave me a compilation error. Any help is highly appreciated.
Thanks. Eddy.
- Jibin_43310Historic F5 Account
Change to the following:
when HTTP_REQUEST { if {{ [HTTP::uri] contains "MAXPROD" } || { [HTTPS::uri] contains "MAXPROD" }} { pool WWW_Maximo_pool } else { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
Same to HTTPS_REQUEST