Hello,
Both new to F5 and iRules here.
Been trying to make an iRule in an F5 BIG-IP LTM 1600 for a few days.
Started of from this one …
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/Organisation1/*" {
pool P_APP_Organisation1
}
"/Organisation2/*" {
pool P_APP_Organisation2
}
"/Organisation3/*" {
pool P_APP_Organisation3
}
default {
HTTP::redirect "
}
}
}
… that was based on " target=“_blank”>this article. It worked “perfectly” but i quickly realized that there was some things that i hadnt tought about so i continued my work to add the following functionality.
- “Easier” manageable list of redirection.
The list might grow to ~375 different “Organisations”. ¨
Is there any better option than an array?
Part of the pool name will always reflect part of the URI or the HOST name.
- Option to not terminate SSL in the F5.
This is due to that some use smart cards for identification and signing inside application.
Common is that the “Organisation” do not have this and SSL is offloaded in the F5.
- “Redirect both with and without /”
I ran into a problem using /Organisation3* since it takes any subsequent numbers starting on 3 aswell. I then tried with /Organisation3/ and /Organisation3/* but if you do not use a trailing slash in your browser it will then fail so i want breakout the first part of the HTTP::uri and make a redirection on that (or the subdomain of the HTTP::host in the long run).
This is what i ended up with …
when HTTP_REQUEST {
array set pools {
Organisation1 P_APP_Organisation1 Y
Organisation2 P_APP_Organisation2 N
Organisation3 P_APP_Organisation3 N
}
foreach {CustPath CustPool SmartCard} [array get pools] {
if { ([getfield [HTTP::uri] "/" 1] equals $CustPath) }{
if { ($SmartCard equals "Y") }{
SSL::disable
HTTP::disable
}
pool $CustPool
return
}
}
HTTP::respond 200 Content "This site does not exist."
}
… however it is not working … at all. The F5 accepts it configuration wise, but i cannot connect to any of the sites any longer. It resets the connection for all of the 3 configured organisations and i have little clue as to why.
Hints and/or parts of solution is appriciated. Thanks in advance!
/ Jonas