For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Wolf46_144992's avatar
Wolf46_144992
Icon for Nimbostratus rankNimbostratus
Feb 21, 2014
Solved

Using a Single Virtual IP to publish multiple URL's

Hi All,

 

I am new around here so sorry if I am asking some silly questions.

 

I would like to be able to make use of a single Virtual IP address to publish multiple URL's. I know this is possible but I would need some help as I am not familiar with iRules.

 

Would it be possible to make some sort of content switching? Basically anaylyze the HTTP headers and depending upon the URL direct the traffic towards a Virtual Server?

 

Just as a clarification we are currently making use of a single certificate with additional SAN's and therefore there should not be a problem with TLS at this time.

 

  • Definitely. You don't even need to use an iRule - an HTTPClass profile would be able to do this for you. http://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html

    You would have a single virtual server and multiple pools, and then use the profile or an iRule to direct traffic to one pool or another based on the Host header.

    If you wanted to use an iRule then a simple format would be;-

    when HTTP_REQUEST {
        switch [HTTP::host] {
            "site1.company.com.au" {
                pool pl_site1
            }
            "site2.company.com.au" {
                pool pl_site1
            }
            default {
                 Use pool attached to virtual - no action required
            }
        }
    }
    

7 Replies

  • Definitely. You don't even need to use an iRule - an HTTPClass profile would be able to do this for you. http://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html

    You would have a single virtual server and multiple pools, and then use the profile or an iRule to direct traffic to one pool or another based on the Host header.

    If you wanted to use an iRule then a simple format would be;-

    when HTTP_REQUEST {
        switch [HTTP::host] {
            "site1.company.com.au" {
                pool pl_site1
            }
            "site2.company.com.au" {
                pool pl_site1
            }
            default {
                 Use pool attached to virtual - no action required
            }
        }
    }
    
    • Wolf46_144992's avatar
      Wolf46_144992
      Icon for Nimbostratus rankNimbostratus
      Hi IheartF5, Thank you for your answer. Seems quite straight forward once you know the syntax of the iRule. I will also try using and HTTPClass as they seem quite simple to use. Do you know if these can be used also when publishing content using an iApp?
  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    You did not mention which version of BIG-IP you are running. From v14.0, "HTTP Class profile" is replaced by "Local Traffic Policies", as far as I know.

     

  • The link I supplied above details the transition to Local Traffic Policies from HTTP Class profiles.

     

    To answer Wolf46 question, as far as I know, whatever works without an iApp will also work with an iApp.

     

    • Wolf46_144992's avatar
      Wolf46_144992
      Icon for Nimbostratus rankNimbostratus
      Does not seem to be working with an iApp as it is not recognizing the pool the iApp creates. "01070151:3: Rule [/Common/HTTP_Host_Content_Switching] error: Unable to find pool (Exchange_2010_OWA_owa_pool) referenced at line 4: [pool Exchange_2010_OWA_owa_pool]" On a different note, can forwarding be made towards a virtual server rather then a pool?