Forum Discussion
Earnest_Dyke_10
Nimbostratus
Feb 16, 2006Simple IRule apparently not working
Greegings all.
We have the IRule below and when we install it and attempt to execute our web app, we see not messages in the log. We do not see any syntax errors messages either. Any ideas why we would be getting no output at all?
Thanks in advance for any and all help!
Earnie!
when RULE_INIT {
log local0. "Earnies rule is being initialized"
}
when HTTP_REQUEST {
Look of each entry in badurl in the URI
set uri [HTTP::uri]
log local0. "Checking uri: $uri"
set badurl [list "http://ww1:80" "https://ww1:80"]
foreach x $badurl {
if {$uri starts_with $x} {
set len [string length $x]
Get all of the URI after the port number
set resource [substr $uri $len]
set outlocation "https://ww1$resource"
log local0. "Changing request for $uri to $outlocation"
HTTP::uri $outlocation
break;
}
}
}
when HTTP_RESPONSE {
If this is not a browser redirect, igonore it
if {[HTTP::status] starts_with "3"} {
set location [HTTP::header "Location"]
if {$location == ""} {
return
}
} else {
return
}
log local0. "Checking location: $location"
Look of each entry in badurl in the redirect location
set badurl [list "http://ww1:80" "https://ww1:80"]
foreach x $badurl {
if {$location starts_with $x} {
set len [string length $x]
Get all of the URI after the port number
set resource [substr $location $len]
set outlocation "https://ww1$resource"
log local0. "Rewriting $location to $outlocation"
HTTP::header replace "Location" $outlocation
break;
}
}
}11 Replies
- Otto_Kretzer_68
Nimbostratus
i will probably have to call support on that, even though i see log entries now in the ltm log file, still not log entries show up under the logging on the gui under locak traffic and is should show up there also. thanks for everyones help, Earnie has figured it out and the rules are working, now just have to get the logging fixed. But thank you again!
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