Forum Discussion
HTTP to HTTPS LTM Policy on network Virtual Server
I would like to redirect all HTTP requests, which come to my F5, to HTTPS sites. I've tried to configure network Virtual Server with attached LTM policy. But it doesn't work. Any ideas, how to deal with it ?
Thank you.
ltm policy /Common/HTTPtoHTTPSpolicy {
controls { forwarding }
requires { http }
rules {
HTTPtoHTTPSrule {
actions {
0 {
http-reply
redirect
location "https://[getfield [HTTP::host] \":\" 1][HTTP::uri]"
}
}
ordinal 1
}
}
strategy /Common/first-match
}
ltm virtual /Common/ALL_HTTP {
destination /Common/10.1.2.0:80
ip-protocol tcp
mask 255.255.255.0
policies {
/Common/HTTPtoHTTPSpolicy { }
}
pool /Common/my_pool
profiles {
/Common/http { }
/Common/tcp { }
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address disabled
translate-port enabled
vlans {
/Common/dmwf
}
vlans-enabled
}
3 Replies
- Hamish
Cirrocumulus
Not that i would try to discourage writing iRules, but to make your life easier, just use the built-in _sys_https_redirect iRule...
H
- Jason_40733
Cirrocumulus
Check to see if your return data is perhaps specifying http.
That could be causing problems depending on what your application is doing.
https://devcentral.f5.com/questions/replace-http-to-https-problems
Jason
- MaCrek_56686
Altocumulus
When I hook same LTM Policy to host virtual server (no network virtual IP), it works wo problems. I've tried also _sys_https_redirect iRule, but wo success.
When I've looked to traffic with tcpdump. It looks, that network VS don't work. F5 send Reset packets only. Is there any specific conditions in which network VS works ?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
