Forum Discussion

steph_01_143006's avatar
steph_01_143006
Icon for Nimbostratus rankNimbostratus
Aug 12, 2014

port translation for pool member

Hello,

I have a VS which listen on port 443. the pool member needs to listen to different ports according the hostname. For example :

  • https://toto.com => GIB-IP (VS 10.1.1.1) => http://node:22020
  • https://titi.com => BIG-IP (VS 10.1.1.1) => http://node:22021

  • The first solution is to creat one VS per port. (the pool member is monitored with right port : 22020 or 22021. But I need to creat as many VS as ports and I have 10 ports.

  • Second solution : The Pool member is monitored with port 80 and I use the IRule associated to only one VS. The Irule should be:

when HTTP_REQUEST {

set HOST [HTTP::host]

switch $HOST {

toto.com {HTTP::header replace Host "[HTTP::host]:22020" }

titi.com {HTTP::header replace Host "[HTTP::host]:22021" }

default { drop }
}

}

But it doesn't work !!! the BIG-IP communicate with pool member with port 80 and not with port implemented in Irule. Do you know why ?

Thank you

2 Replies

  • It's not enough to add the port number to the Host header (in fact you may not even need to do that) - you need select a pool based on the port you want (so you will need 10 pools - one for each port);-

    when HTTP_REQUEST { 
        switch [string tolower [HTTP::host]] { 
            "toto.com" { 
                HTTP::header replace Host "[HTTP::host]:22020"
                pool pl_mypool_22020 
            } 
            "titi.com" { 
                HTTP::header replace Host "[HTTP::host]:22021"
                pool pl_mypool_22021 
            } 
            default { 
                drop 
            } 
        } 
    }