Forum Discussion
http to https redirect policy IPv6
Looking to redirect http to https on a IPv6 vip and our standard redirection policy doesn't seem to be working correctly.
Here's the current redirection rule:
tcl:https://[getfield [HTTP::host] ":" 1][HTTP::uri]
Does anyone know what I need to do to get this same functionality with IPv6?
- SurgeonRet. Employee
it does not matter whether you use ipv4 or ipv6. HTTP is application layer and it works on top of tcp stack.
You can check next article for redirect iRule example and create your own
https://devcentral.f5.com/wiki/iRules.http__redirect.ashx
- VernonWells
Employee
It's because of the port split you are attempting to use, namely this bit:
getfield [HTTP::host] ":" 1
Since the IPv6 address itself it converted to a string using colons, you cannot use this mechanism to extract the port. You could do this:
getfield [HTTP::host] "]" 1
then re-add the closing square brace in the redirect, as in:
https://[getfield [HTTP::host] {]} 1]\][HTTP::uri]
or, if you know a port is not submitted (usually it's not if the port is 80 or 443 for TLS), simply don't try to remove the port.
Naturally, this means that you will need to use a slightly different rule for IPv4 Virtual Servers and IPv6 Virtual Servers.
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