Forum Discussion
Mohanish_169493
Nimbostratus
Jun 25, 2015Irule not working
Hi,
I have written an Irule as below
when HTTP_REQUEST {
if{([HTTP::host] contains"eulyncweb01.csmglobal.net")and([HTTP::uri] contains"/RequestHandler/Files/UCPhone")
node 10.96.96.16 80 ...
Stanislas_Piro2
Cumulonimbus
Jun 25, 2015since 11.4, the best way to do what you want is to create a LTM policy. it is easier to configure in GUI and best to see rules.
The following lines allow to create policy in TMSH and create expected rules:
create ltm policy /Common/eulyncweb01-HTTP requires add { http } strategy first-match controls add { forwarding }
modify ltm policy /Common/eulyncweb01-HTTP rules add {UCPhone { actions add { 0 { forward select node 10.96.96.16 } } conditions add { 1 { http-host host values { eulyncweb01.csmglobal.net } } 2 { http-uri path contains values { "/RequestHandler/Files/UCPhone" } } } ordinal 1 }}
modify ltm policy /Common/eulyncweb01-HTTP rules add {redirect { actions add { 0 { http-reply redirect location https://[HTTP:host][HTTP::uri] } } ordinal 2 }}
and the configuration is: (you can load it with tmsh load sys merge from-terminal
ltm policy eulyncweb01-HTTP {
controls { forwarding }
requires { http }
rules {
UCPhone {
actions {
0 {
forward
select
node 10.96.96.16
}
}
conditions {
1 {
http-host
host
values { eulyncweb01.csmglobal.net }
}
2 {
http-uri
path
contains
values { /RequestHandler/Files/UCPhone }
}
}
ordinal 1
}
redirect {
actions {
0 {
http-reply
redirect
location https://[HTTP:host][HTTP::uri]
}
}
ordinal 2
}
}
strategy first-match
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects