Forum Discussion
nitass
Feb 23, 2014Employee
e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar80
ltm virtual bar80 {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 12
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar443
ltm virtual bar443 {
destination 172.28.24.10:443
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
clientssl {
context clientside
}
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 13
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] eq "example.com" and [HTTP::uri] eq "/" } {
HTTP::redirect "https://[HTTP::host]/welcome/welcome.htm"
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/ -H "Host: example.com"
HTTP/1.0 302 Found
Location: https://example.com/welcome/welcome.htm
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -Ik https://172.28.24.10/ -H "Host: example.com"
HTTP/1.0 302 Found
Location: https://example.com/welcome/welcome.htm
Server: BigIP
Connection: Keep-Alive
Content-Length: 0