Forum Discussion
Mojdeh_Koushki_
Nimbostratus
Oct 14, 2005iRule Script in Ver 9 is not functioning
hello
here is my problem, i have a set of bigip for bunch of web farm on ver 4.5.10, which i have this iRule for it and it is functioning Very Well...
if (getfield(http_uri, '/', 2) matches_regex "[Ww][Ee][Bb][Aa][Pp][Pp]") {
redirect to "https://%h/%u"
}
else {
use pool WebApp-50
}
and now we are upgrading to version 9 and compatable iRule for version 9 is COMPILING but NOT FUNCTIONING ...
here is the script...
when HTTP_REQUEST {
if { [string tolower [getfield [HTTP::uri] '/' 2]] == "webapp" } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} else {
pool POOL_HTTP_Vlan70
}
}could you please tell me WHY?
thanks alot
Mojdeh
51 Replies
- Colin_Walker_12Historic F5 AccountSo given this rule:
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] if { ($uri starts_with "/webnav") or ($uri starts_with "/webapp") } { log local0. "URI matches, redirecting to HTTPS" HTTP::redirect "https://[HTTP::host][HTTP::uri]" } else { log local0. "No match, forwarding to the pool" pool POOL_HTTP_Vlan70 } }
The request should be redirected to the same host and uri, but using https, if the uri starts with either webnav, or webapp. Otherwise it will be passed to the http pool listed.
When testing this, if it "freezes", please be sure to check the logs to see what occured in the rule.
-Colin - Mojdeh_Koushki_
Nimbostratus
well ... i am running this which looks like the script you send it to me ....
i think problem is when it took action and redirect http to https , then is not doing anything , should it send traffic to pool .... it is just stay there ... does not going to any page or any change on the web page appear ...
do you want to test it from your matchine to get the feeling ?
MK - Mojdeh_Koushki_
Nimbostratus
i will apply your suggestion with debug lines and test it and will post the resault on the log here ...
give me a min.... - Colin_Walker_12Historic F5 AccountIf you're not using exactly the rule that I sent you, I have no way of knowing what is actually occuring in the rule, since it may be different.
Please implement the rule I posted, and test again.
-Colin - Mojdeh_Koushki_
Nimbostratus
sure ... i just apply your script .... - Mojdeh_Koushki_
Nimbostratus
Colin ... i have a question
i am using ssl proxy for my load balancer, means i am accepting http or https from outside hitting my vitrual server public ip, and then i have a pool_vlan70 which are my webfarm had a round bobin for load balancing ....
it supposed to if get https from outside request , it send it as http request to www farm ( using less system resources )
so do you think we should add pool POOL_Vlan 70 after redirect statment, because no mater what http or https conncetion at the end have to go to web farm through www pool? - Colin_Walker_12Historic F5 AccountSo what were the results when you tested the rule I posted?
-Colin - Mojdeh_Koushki_
Nimbostratus
Coline
here you are i test it ... same resault :
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
Oct 17 17:51:50 tmm tmm[628]: Rule coline : URI matches, redirecting to HTTPS
and it freezz again - unRuleY_95363Historic F5 AccountI don't think the problem is with your iRule. It is probably working. I think your problem is that after the browser has been redirected, you https virtual is not doing the right thing. This is probably why it appears to freeze. What happens if you type in the https url directly into the browser? Does it work as expected?
- Mojdeh_Koushki_
Nimbostratus
let me check the Colin's solution ... give me a 10 min
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
