Forum Discussion
aschi
Nimbostratus
Mar 06, 2013https to http redirect
Hello
I have the following Problem.
What ist running at the moment:
->
->
->
Every Request to the "url", even on Port 80 must be redirected to https.
We have...
nitass
Employee
Mar 07, 2013is it something like this?
http virtual server
[root@ve10:Active] config b virtual bar80 list
virtual bar80 {
destination 172.28.19.252:80
ip protocol 6
rules https_redirect_rule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule https_redirect_rule list
rule https_redirect_rule {
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
https virtual server
[root@ve10:Active] config b virtual bar443 list
virtual bar443 {
snat automap
destination 172.28.19.252:443
ip protocol 6
rules myrule
profiles {
clientssl {
clientside
}
http {}
serverssl {
serverside
}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set host [HTTP::host]
set uri [HTTP::uri]
switch [string tolower [HTTP::path]] {
"/uri1" {
pool server1
}
"/uri2" -
"/uri3" {
SSL::disable serverside
pool server23
}
default {
do something
}
}
}
when HTTP_RESPONSE {
log local0. "conn [IP::client_addr]:[TCP::client_port] > [clientside {IP::local_addr}]:[clientside {TCP::local_port}] > [IP::remote_addr]:[TCP::remote_port] | host $host | uri $uri | pool [LB::server pool]"
}
}
[root@ve10:Active] config b pool server1 list
pool server1 {
members 200.200.200.101:443 {}
}
[root@ve10:Active] config b pool server23 list
pool server23 {
members {
200.200.200.101:80 {}
200.200.200.111:80 {}
}
}
test
[root@ve10:Active] config cat /var/log/ltm
Mar 7 22:00:51 local/tmm info tmm[22185]: Rule myrule : conn 172.28.19.251:44555 > 172.28.19.252:443 > 200.200.200.101:443 | host 172.28.19.252 | uri /uri1 | pool server1
Mar 7 22:00:53 local/tmm info tmm[22185]: Rule myrule : conn 172.28.19.251:44556 > 172.28.19.252:443 > 200.200.200.101:80 | host 172.28.19.252 | uri /uri2 | pool server23
Mar 7 22:00:54 local/tmm info tmm[22185]: Rule myrule : conn 172.28.19.251:44557 > 172.28.19.252:443 > 200.200.200.111:80 | host 172.28.19.252 | uri /uri3 | pool server23
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects