Forum Discussion
notification irule
Hello
I am having problems with one irule. Irule is distributing connections to pools based on hostname. Rule is working fine. Then I tried to add notification for clients using sslv3 connections. This rule is partially working. Problem is that when you call hostname (e.g. test1.mysite.com) from browser and you are using sslv3, you get proper notification. But when you call direct application link (e.g. test1.mysite.com/index.php) notification doesn't appear.
Here is my irule
if { ([HTTP::host] starts_with "test1.") and ([SSL::cipher version] eq "SSLv3") } {
respond with notification page
switch [HTTP::uri] {
"/" {HTTP::respond 200 content [ifile get sslv3_response]}
"/logo.jpg" {HTTP::respond 200 content [ifile get logo]}
}
}
if { [HTTP::host] starts_with "test1." } {
pool TEST1_pool
}
if { ([HTTP::host] starts_with "test2.") and ([SSL::cipher version] eq "SSLv3") } {
respond with notification page
switch [HTTP::uri] {
"/" {HTTP::respond 200 content [ifile get sslv3_response]}
"/logo.jpg" {HTTP::respond 200 content [ifile get logo]}
}
}
if { [HTTP::host] starts_with "test2." } {
pool TEST2_pool
}
}
- nitassEmployee
But when you call direct application link (e.g. test1.mysite.com/index.php) notification doesn't appear.
because you do not have /index.php in switch pattern. you may try "default" switch pattern to catch all.
- gapexx_138014Nimbostratus
Thanks for the hint. You were right. I was missing pattern to catch all. I managed to solve issue with rule bellow. I had to use -glob, add pattern to catch all (/*) and also moved logo.jpg to the top.
if { ([HTTP::host] starts_with "test2.") and ([SSL::cipher version] eq "SSLv3") } { respond with notification page switch -glob [HTTP::uri] { "/logo.jpg" {HTTP::respond 200 content [ifile get logo]} "/" - "/*" {HTTP::respond 200 content [ifile get sslv3_response]} } } if { [HTTP::host] starts_with "test2." } { pool TEST2_pool } }
- nitassEmployeethanks for update. i think not using -glob and changing /* to default will do the same too.
Recent Discussions
Related Content
* 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