Forum Discussion

THASIN's avatar
THASIN
Icon for Nimbostratus rankNimbostratus
Aug 17, 2010

Change HOST and append port

Hi Scenario Two VIP defined, HTTP_VS and HTTPS_VS, Nodes are listening on 9001. HTTP_VS is working fine. But HTTPS_VS is not working. Keep on asking username and password. 1.SNAT auto map enabled 2.CLIENT SSL Profile configured 3.HTTP, TCP profiles selected 4.HTTP _VS listening on port 80 5.HTTP_VS listening on port 443 6.Nodes are listening on port 9001 Problem HTTP _VS (1)Client connected to server directly it will stay on port 9001. (2)Working fine after user authentication HTTPS_VS (1) Client connected F5 (https) and F5 forwarded the request to backend Server (using port 9001) the connection will be redirect to http after login. 2. Keep on asking username and password In the problem situation Host header is: Host: 192.168.11.79 ( VIP) Because the connection is https so the default port (443) is skipped by browser. In the good situation Host header is: Host: 192.168.12.70:9001 ( NODE IP) Because the connection is in port 9001 not 80 or 443, the port is still there. 3. When the request is forworded to backend server the https encapsulation is stripped and F5 uses port 9001 to communicate with server but the header has not been changed at all. It is still "Host: 192.168.11.29" 4. The server uses host header to generate the redirection link. And in result we can get the different link address from the page: id="loginform" name="loginform" method="post" action="http://192.168.11.79:80/UNIMO/ui/login?welcome=true" onsubmit="loginsubmit(event);" style="margin:0px"> When client got the page the redirection link is hard coded with http so the link will be redirected to http after posting the username/password. Solution Could you someone help me to create a irule to change the host and append port in the redirect link Regards INSITHA

3 Replies

  • Do you want the F5 to append :9001 to the traffic it sends to the server? Or are you looking for something else?
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    You can use an iRule to insert the server IP and port as the Host header value:

    
    when HTTP_REQUEST_SEND {
        Need to force the host header replacement and HTTP:: commands into the clientside context
        as the HTTP_REQUEST_SEND event is in the serverside context
       clientside {
           Replace the HTTP host header with the selected server IP and port
          HTTP::header replace Host "[LB::server addr]:[LB::server port]"
       }
    }
    

    Aaron