Forum Discussion

theShell0x0_342's avatar
theShell0x0_342
Icon for Nimbostratus rankNimbostratus
Nov 27, 2017

VS in port different from node port

Hello,

 

I've a Virtual Server listining in a port 9444 and two nodes in port 9444 and 9447 when the node:9447 responde to the request the url port change as well, how to prevent this behavior?

 

VS:9444 node1:9444 node2:9447

 

Client request URL:

 

above url change if node2 respond to the request.

 

please need help.

 

regards,

 

1 Reply

  • Hi theShell0x0,

    you may take a look to the iRule below. It uses the

    HTTP_REQUEST_SEND
    event to enumerate the currently selected pool member and if the pool member IP matches a given criteria it will overwrite the requested HOST-header value to reflect the changed port number...

    when HTTP_REQUEST_SEND {
        if { [IP::server_addr] eq "1.2.3.4" } then {
            clientside {
                HTTP::host "vs-hostname:9447"
            }
        }
    }
    

    Note: Depending on the behaviour of your web application, it may be also required to parse the HTTP reponses (e.g. HTTP-Redirects, Links in HTML-Source) to untranslate the internal HOST-header value to reflect the external HOST-header value again.

    Cheers, Kai