Forum Discussion
LB irule and where to place in whith in an exisitng rule
Simple enough, your second iRule should look like this:
when HTTP_REQUEST {
CHANGE ALL POOL NAMES TO MATCH THOSE IN YOUR ENVIRONMENT.
YOU MIGHT CHOOSE TO USE THE SAME POOL FOR OWA, ECP and EWS.
OAB and Autodiscover do not require persistence.
switch -glob -- [string tolower [HTTP::path]] {
"/microsoft-server-activesync" {
Direct all ActiveSync clients to a common pool; use Auth
header value if it exists (Basic auth only, which is the
default); otherwise we fall back to client IP
if { [HTTP::header exists "APM_session"] } {
persist uie [HTTP::header "APM_session"] 7200
}
elseif { [HTTP::header exists "Authorization"] } {
persist uie [HTTP::header "Authorization"] 7200
}
else {
persist source_addr
}
pool OwaMail_combined_vs_owa_pool
return
}
"/ews*" {
if { [HTTP::header exists "APM_session"] } {
persist uie [HTTP::header "APM_session"] 7200
}
else {
persist cookie
}
pool OwaMail_combined_vs_owa_pool
return
}
"/ecp*" {
if { [HTTP::header exists "APM_session"] } {
persist uie [HTTP::header "APM_session"] 7200
}
else {
persist cookie
}
pool OwaMail_combined_vs_owa_pool
return
}
"/oab*" {
pool OwaMail_combined_vs_owa_pool
return
}
"/rpc/rpcproxy.dll" {
if { [HTTP::header exists "APM_session"] } {
persist uie [HTTP::header "APM_session"] 7200
}
else {
switch -glob [string tolower [HTTP::header "User-Agent"]] {
"msrpc" {
if { [HTTP::cookie exists "OutlookSession"] } {
persist uie [HTTP::cookie "OutlookSession"] 7200
}
else {
persist uie [HTTP::header "Authorization"] 7200
}
}
"*microsoft office*" {
This section matches some versions of Outlook 2007 on Windows XP
persist uie [HTTP::header "Authorization"] 7200
}
default {
This section catches all other requests for Outlook
Anywhere, and sets a persistence method that does
not require the client to support HTTP cookies
persist source_addr
}
}
}
Finally, this assigns the Outlook Anywhere pool. If the preceding clients
should be sent to separate pools, the pool statement should be removed
here, and a separate pool statement placed in each of the preceding
logic branches.
pool OwaMail_combined_vs_owa_pool
return
}
"/autodiscover*" {
Requests for Autodiscovery information. No Persistence.
pool OwaMail_combined_vs_ad_pool
return
}
"/webconsole*" {
pool OWA_webconsole_pool
}
default {
This final section takes all traffic that has not otherwise
been accounted for and sends it to the pool for Outlook Web App
if { [HTTP::header exists "APM_session"] } {
persist uie [HTTP::header "APM_session"] 7200
} else {
persist cookie
}
pool OwaMail_combined_vs_ad_pool
}
}
}
when HTTP_RESPONSE {
if { [HTTP::header values WWW-Authenticate] contains "Negotiate" } {
ONECONNECT::detach disable
log local0. "OC disabled for Negotiate my_ex_single_persist"
}
}
So webconsole is added as another label for the same switch-statement that selects all the other pools depending on the path of the URI. So the logic certainly belong in this iRule. To answer your questions - it is correct to merge this into the same iRule because it deals with the same type of decision, but even if you put it as a separate rule it wouldn't negate anything done previously unless there was a conflict between the two iRules. These iRules all handle different URI:s so there's no conflict.
And the iRule that adds "owa" only does so when the URI is exactly "/". It probably should look for an empty URI as well but I guess the webserver will handle that.
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