Forum Discussion
Help with irule for setting serverssl to enable
Hi, I need help with an irule. Currently this irule sets the serverssl to enabled on a Virtual server if the URL starts with a particular set of characters, which works fine. In the code below I am calling it "abc". What I need to do now is add another URL, "def" to that so I tried by putting "or" and then the other URL but it doesn't seem to work. Please see the current code below.
when HTTP_REQUEST {
set my_pool [class match -value [string tolower [HTTP::host]] starts_with URL_pools]
log local0. "[HTTP::host] --> $my_pool "
if {$my_pool ne ""} {
pool $my_pool
}
unset my_pool
set useServerSSL 0
if { [HTTP::host] starts_with "abc" } {
set useServerSSL 1
}
}
when SERVER_CONNECTED { if { $useServerSSL == 0 } { SSL::disable serverside } }
I tried putting in the second URL (def) after the "abc" as shown below but then both url's don't work.
if { [HTTP::host] starts_with "abc" or [HTTP::host] starts_with "def" } {
set useServerSSL 1
}
I would appreciate any help. Thank you.
- Kevin_Stewart
Employee
Try this:
if { ( [HTTP::host] starts_with "abc" ) or ( [HTTP::host] starts_with "def" ) } { set useServerSSL 1 }
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