Forum Discussion

Wes_Emerson_868's avatar
Wes_Emerson_868
Icon for Nimbostratus rankNimbostratus
May 02, 2007

Port Redirection iRule

I found the bit to redirect 80 to 443, to redirecto to a different port, say 8509, would I need to create a different iRule and Virtual Server, or could I tape it on to the end of the 80->443 rule.

 

 

I've looked through the documentation and I didn't see a real easy way to do that (atleast that made sense to me).

1 Reply

  • You can modify the codeshare example to specify a port:

    http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPtoHTTPSredirect.html

    Click here

    
    when HTTP_REQUEST {
      HTTP::redirect http://[getfield [HTTP::host] ":" 1]:8509[HTTP::uri]
    }

    This example will strip off any existing port in the HTTP host header and redirect requests to the same host and URI via HTTP on port 8509.

    You would want to create a virtual server on the port you want to redirect from and then select this rule in the resources tab.

    Aaron