Forum Discussion
How to Prevent xyz-da-bhht.abc.net from Redirecting to HTTPS
We are having an issue with the Intermittent URL: xyz-da-bhht.abc.net which is served by pool: ctx-da-bhht but this is mainly because of the handheld RF scanners, might be these are breaking while redirecting to HTTPS.
While the 2nd part is related to URL: xyz-da-app.abc.net served by pool : “ctx-da-app” which got the below extensions : which is working good.
Current Irule in place is the below:
when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https
switch -glob [string tolower [HTTP::host]] {
"xyz-da-bhht.abc.net" { pool ctx-da-bhht }
}
check for pages needing to not redirect to https
switch -glob [string tolower [HTTP::uri]] {
"*/getxsl.asp*" { pool ctx-da-app }
"*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app }
"*/RadSOFileTransfer.asp*" { pool ctx-da-app }
"*/Reader.sod*" { pool ctx-da-app }
"*/clockserver.asp*" { pool ctx-da-app }
"*/webapp*" { pool ctx-da-bhht }
default { HTTP::redirect https://[HTTP::host][HTTP::uri] }
}
}
How to divide this Irule in two parts, keeping in mind xyz-da-bhht.abc.net should not redirect to HTTPS while others should have. Any suggestion.
Thanks and Regards Parveez
4 Replies
- Thomas_Gobet_91
Cirrostratus
Hi,
I think you have to use a flag to know if your host is bhht or not.
when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https set bhht 0; switch -glob [string tolower [HTTP::host]] { "xyz-da-bhht.abc.net" { pool ctx-da-bhht } $bhht=1; } check for pages needing to not redirect to https switch -glob [string tolower [HTTP::uri]] { "*/getxsl.asp*" { pool ctx-da-app } "*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app } "*/RadSOFileTransfer.asp*" { pool ctx-da-app } "*/Reader.sod*" { pool ctx-da-app } "*/clockserver.asp*" { pool ctx-da-app } "*/webapp*" { pool ctx-da-bhht } default { if { $bhht -eq 0) { HTTP::redirect https://[HTTP::host][HTTP::uri] } } } }- Cory_50405
Noctilucent
In addition, make sure your match strings don't contain capital letters since you are converting the URI string to lowercase. Otherwise those conditions will never match.
- Thomas_Gobet
Nimbostratus
Hi,
I think you have to use a flag to know if your host is bhht or not.
when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https set bhht 0; switch -glob [string tolower [HTTP::host]] { "xyz-da-bhht.abc.net" { pool ctx-da-bhht } $bhht=1; } check for pages needing to not redirect to https switch -glob [string tolower [HTTP::uri]] { "*/getxsl.asp*" { pool ctx-da-app } "*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app } "*/RadSOFileTransfer.asp*" { pool ctx-da-app } "*/Reader.sod*" { pool ctx-da-app } "*/clockserver.asp*" { pool ctx-da-app } "*/webapp*" { pool ctx-da-bhht } default { if { $bhht -eq 0) { HTTP::redirect https://[HTTP::host][HTTP::uri] } } } }- Cory_50405
Noctilucent
In addition, make sure your match strings don't contain capital letters since you are converting the URI string to lowercase. Otherwise those conditions will never match.
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