Forum Discussion

Guy_Goodenough_'s avatar
Guy_Goodenough_
Icon for Nimbostratus rankNimbostratus
Sep 27, 2018

Port redirect for only *some* urls

I have a web server that is set up with the basic http iApp, and is configured to accept traffic on port 443, and redirect traffic on port 80 to 443. The web server itself accepts traffic on port 443 for most urls, but requires port 6443 for others, e.g.:

 

https://mywebserver.domain.com/login

 

Only works on port 443, whereas everything under the 'subdir' url

 

https://mywebserver.domain.com/subdir/webpage

 

Requires port 6443 to be accessed. Does anyone know of a way to handle this easily with an irule, preferably without showing :6443 in the url?

 

Thanks in advance!

 

  • One option is to create two pools and use an iRule to select a pool based on URI.

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] starts_with "/subdir" } {
            pool mypool_6443
        } else {
            pool mypool_443
        }
    }
    

    You'll also want to enable OneConnect on the VIP. You could also do this pool selection with a CPM policy.

  • The redirect VIP shouldn't be doing anything but redirecting. There shouldn't be any pools or any other iRules assigned to it.

     

    OneConnect for HTTP requires two settings:

     

    • The OneConnect Transformation setting in the HTTP profile (enabled)
    • The OneConnect profile applied to the VIP