Forum Discussion

DWillis_251723's avatar
DWillis_251723
Icon for Nimbostratus rankNimbostratus
Oct 03, 2016

Port 443 iRule Redirect to port 8443

I am created an iRule to forward requests from 443 to port 8443 but it does not seem to be redirecting. There are 2 different urls inlcluded in the iRule. I setup 2 virtual servers. 1 is listening on port 443 with iRule applied and the other is listening on port 8443. Here is an example of the iRule I created.

 

when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "https://mysite.org/CMC" } { HTTP::redirect "https://mysite.org:8443/BOE/CMC" } if { [string tolower [HTTP::host]] equals "https://mysite.org/BI" } { HTTP::redirect "https://mysite.org:8443/BOE/BI" } { } } Did I write this incorrectly? Any help is greatly appreciated.

 

5 Replies

  • Are these Pasthru VIPs? If not, maybe add the needed 8443 port to the Pool member? 443(Internet) -> F5 -> PoolMember:8443

     

    If the same host is listening to 443 and 8443, you could add two pool members with the same IP and add one with 443 and the other with 8443 --?

     

  • Not a pass thru. The virtual server listening on port8443 does have a pool associated with port 8443. It works without issue when entering the full url but the iRule is not redirecting if the user does not enter the full :8443/BOE/CMC. Was looking for the iRule to add the :8443/BOE automatically.

     

  • Within your iRule, you would have to use these 2:

     

    HTTP::host [HTTP::host]:8443

     

     

    HTTP::uri /BOE[HTTP::uri]

     

    If you are looking to add ":8443" to domain and /BOE to the URI and pass it to the servers.