Presumably you don't care about the query string (if present), so you can simply focus on the path. If there are relatively few exception URIs that aren't being forwarded to HTTPS, you might code something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/foo/" -
"/bar*" -
"/some/particularly/long/example/" { return }
default {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
}
If there are a large number of URIs, you might consider creating a data group and using class match instead of the switch command.
when HTTP_REQUEST {
if { [class match [HTTP::path] starts_with exception_URI_list] } {
return
}
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}