not sure if i understand correctly. is it something like this?
[root@ve1023:Active] config b virtual bar80 list
virtual bar80 {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules rule80
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b class Secure list
class Secure {
{
"/abc"
"/x/ghj"
"httpsecure=Y"
"httpsecure=y"
}
}
[root@ve1023:Active] config b rule rule80 list
rule rule80 {
when HTTP_REQUEST {
if { [class match -- [string tolower [HTTP::uri]] contains Secure] } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
[root@ve1023:Active] config b virtual bar443 list
virtual bar443 {
snat automap
pool foo
destination 172.28.19.79:443
ip protocol 6
rules rule443
profiles {
clientssl {
clientside
}
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule rule443 list
rule rule443 {
when HTTP_REQUEST {
if { not [class match -- [string tolower [HTTP::uri]] contains Secure] } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79/x/ghj/something
HTTP/1.0 302 Found
Location: https://172.28.19.79/x/ghj/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -Ik https://172.28.19.79/zxcv/something
HTTP/1.0 302 Found
Location: http://172.28.19.79/zxcv/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0