Forum Discussion

sparkyeng_23072's avatar
sparkyeng_23072
Icon for Nimbostratus rankNimbostratus
Jul 16, 2018

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?

 

2 Replies

  • 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.