Redirect from HTTP to HTTPS if SSL Profile exists on the HTTPS virtual server
We have several load balancers configured on this F5 using the following irule:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "Redacted URI" { return } "Redacted URI" { return } "Redacted URI" { return } "Redacted URI" { return } "Redacted URI" { return } default { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } } }
This is applied to the HTTP Virtual server which successfully redirects all incoming requests that are HTTP to the HTTPS virtual server.
What we are needing now is a way to exempt the above from happening in the event that the virtual server with all of the ssl profiles does not actually have an SSL profile for the requested URI.
Outside of writing in an exemption for each URI, is there a way to look at the virtual server and verify the incoming URI does or does not have an ssl profile applied on the other virtual server?