Forum Discussion
Kindly Assist in Understanding the Below Irule
Allow me clean that up a bit:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
check for pages needing to not redirect to https
switch -glob [string tolower [HTTP::uri]] {
"/getxsl.asp*" { pool $default_pool}
"/radsomsgreceivertri.asp*" { pool $default_pool }
"/radsofiletransfer.asp*" { pool $default_pool }
"/reader.sod*" { pool $default_pool }
"/clockserver.asp*" { pool $default_pool }
default { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
}
Is the above irule stating: HTTP to HTTPS redirect except the extensions: /getxsl.asp,/radsomsgreceivertri.asp,/radsofiletransfer.asp,/reader.sod,/clockserver.asp ??
The answer then would be yes. If the request URI matches any of the defined URIs, traffic will proceed to the GUI-defined pool. If it doesn't match anything, it will fall through to the default condition and redirect to HTTPS. I tweaked it a little bit though. You're using a -glob switch but not defining any glob conditions, so while it would match "/getxsl.asp", it would not match "/getxsl.asp?". Adding the star character at the end allows the URI to grow.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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