Forum Discussion

fik_136556's avatar
fik_136556
Icon for Nimbostratus rankNimbostratus
Dec 02, 2013

Port Translate for 1 Server with Many Port

Hi

 

I have a question to ask you guys. I have configured as below;

 

Pool Name: Pool7004 - server1 port 7004 - server2 port 7004

 

-Virtual Server Name: Pool7004_80 I do the port translate to HTTP 80. It work as I want it. So user no need to enter port 7004 when browse to that server. example before: www.test.com:7004/flash after:www.test.com/flash

 

The problem is this server has many different services and port. I have configured as usual the pool and virtual server base on the service port. Example: www.test1.com:8004/gigs www.test2.com:9004/left

 

I need this port also translate to port 80 as user don't need to enter the port when browsing. Can it be done within the same server.

 

Thanks a lots

 

7 Replies

  • Is there any mapping scheme to the URIs and ports? Example:

    /left = 7004
    /gigs = 8004
    /flash = 7004
    
  • HI Kevin

     

    Thanks for reply. I'm not doing any mapping scheme or irule. Not so familiar with irule code.

     

    I just tick the port translate in advance mode of Virtual Server.

     

    Thanks

     

  • Hi,

     

    The question is not on your iRule configuration but on your Webserver.

     

    That will permit us to give you the iRule you need.

     

  • Virtual_Server_8004 - 10.1.1.2:8004 Virtual_Server_7004 - 10.1.1.2:7004 Virtual_Server_9704 - 10.1.1.2:9704

     

    I have created all this VS in F5. All working fine. User need to enter full url with port to browse the web app.

     

    FYI, this is weblogic oracle server. that's why got so many services and port within the same server. yes the webserver already map this port and url. All working fine. I just need to translate all port to 80 port.

     

    Thanks for reply.

     

  • Here is the iRule you need. You have to apply in on your virtual server listening on port 80.

    when HTTP_REQUEST {
        switch [HTTP::uri] {
            /left { 
                pool left_pool_port
            }
            /gigs { 
                 pool gigs_pool_port
            }
            /flash { 
                 pool flash_pool_port
            }
        }
    }
    
  • Hi

     

    Thank thomas.

     

    I will try it.

     

    Virtual Server port 80 I need to bind it with which Pool ? All Pool port or how ?

     

    Thanks

     

  • Hi,

     

    You don't need to bind your virtual server with a default pool if every condition are matched by your iRule.

     

    If there's a default condition, you have 2 options :

     

    • Add this to your iRule :

       

      default { pool default_pool_name }

       

    • Define a default pool in your virtual server parameters.