Forum Discussion
Simon_Wright_85
Nimbostratus
Sep 14, 2007Strange F5 behaviour after adding an iRule
Hi all
We are seeing some very strange behaviour from a pair of our 1500 LTMs running 9.4.0 after restoring a config from a backup to them. The symptom is that a large part of the configuration dissapears in the GUI but looking at the bigip.conf file every think is there. The missing parts are iRules, pools, nodes and virtual servers.
I have narrowed it down to the addition of an iRule (listed below). I cannot guarantee that this is what is causing the problem but once i add this irule, backup the unit and then restore the backup lots of things go missing. I have run a windiff on bigip.conf files taken before and after adding the irule and the only difference between them asside from the date is the text for the irule being in there.
I know this isnt a support forum (we do have a support case open about this) but I am wondering if anyone can see any problem with the irule. It has been on the units for several months but we only tried restoring a config recently when the problem came to light.
My question is does anyone know if there is anything fundamentaly wrong with the rule that they can see?
Thanks in advance
Simon
when HTTP_REQUEST {
if { [HTTP::host] contains "reports."} {
if { [HTTP::uri] == "/" } {
HTTP::redirect https://[HTTP::host]
}
else {HTTP::redirect https://[HTTP::host][HTTP::uri] }
}
elseif { [HTTP::uri] == "/" } {
set cluster1Idx [matchclass [string tolower [HTTP::host]] contains $::G2Cluster1]
if { $cluster1Idx != 0 }
{
set lea [lindex $::G2Cluster1 [expr $cluster1Idx - 1]]
HTTP::redirect https://[HTTP::host]/$lea/
}
else
{
set cluster2Idx [matchclass [string tolower [HTTP::host]] contains $::G2Cluster2]
if { $cluster2Idx != 0 }
{
set lea [lindex $::G2Cluster2 [expr $cluster2Idx - 1]]
HTTP::redirect https://[HTTP::host]/$lea/
}
}
}
else {HTTP::redirect https://[HTTP::host][HTTP::uri] }
}
- Simon_Wright_85
Nimbostratus
Hi allwhen HTTP_REQUEST { if { [HTTP::host] contains "reports."} { } else {HTTP::redirect https://[HTTP::host][HTTP::uri] } }
when HTTP_REQUEST { if { [HTTP::host] contains "reports."} { HTTP::redirect https://[HTTP::host][HTTP::uri] } else {} }
- Simon_Wright_85
Nimbostratus
It turns out i just needed to put quotes around the redirect as shown below.when HTTP_REQUEST { if { [HTTP::host] contains "reports."} { } else {HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- Deb_Allen_18Historic F5 AccountHi Simon --
- Simon_Wright_85
Nimbostratus
Hi Deb
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