Forum Discussion
Pradeep_Siwach_
Jul 17, 2012Nimbostratus
HTTPS Request irule
Hi,
We have VS with SSL client profile and the redirection irule configured for HTTP VS.
Currently the site www.xyz.com or xyz.com get redirected to https://www.xyz.com due to irule configuration on HTTP VS.
However when client request for https://xyz.com the redirection is not happening even though the following irule is configured.
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] eq "xyz.co.in" &&
[TCP::local_port] == 443 } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
}
Kindly help in fixing the issue.
Appreciate your prompt response and support.
- Brian_Van_StoneNimbostratus[HTTP::host] should return "xyz.com" when https://xyz.com is requested. Try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "xyz.com" } { HTTP::redirect "https://www.[HTTP::host][HTTP::uri]" } }
This iRule needs to go on the https VS, not the http one.
- Pradeep_Siwach_NimbostratusHi Brian,
- natheCirrocumulusPradeep
- Pradeep_Siwach_NimbostratusHi Nathan,
- nitassEmployeeWhenever we go for URL https://xyz.com it gives Connection reset but when we provide the URI along with it redirect properly such as https://xyz.com/home.aspx.wondering what result is when running curl.
[root@ve10:Active] config b virtual bar list virtual bar { destination 172.28.19.79:443 ip protocol 6 rules myrule profiles { clientssl { clientside } http {} tcp {} } } [root@ve10:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "xyz.com" } { HTTP::redirect "https://www.[HTTP::host][HTTP::uri]" } } }
- nitassEmployeesorry i forgot to paste the result. 🙂
[root@ve10:Active] config curl -Ik https://172.28.19.79 -H "Host: xyz.com" HTTP/1.0 302 Found Location: https://www.xyz.com/ Server: BigIP Connection: Keep-Alive Content-Length: 0
- Pradeep_Siwach_NimbostratusHi,
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