Forum Discussion

John_Klemm_4418's avatar
John_Klemm_4418
Icon for Nimbostratus rankNimbostratus
Oct 17, 2006

http headers

Okay....I am new at this. I have two servers that are acting hand in hand, Meaning that if you try to access a website either server can pickup the request. The problem I am having is that I have to create an irule for 7 different sites that will reside on these boxes. I know you could just assign a different IP address for each individual website...we are limited in our addresses so our sharepoint team would like to run 7 different website on this server with only two addresses. The problem is one I do not understand the code in creating an irule as I have been pushed into taking care of the BigIP machine. I am asking that anyone with information please, help!!!!!

8 Replies

  • If your DNS all points to the same VIP and your backend servers know which content to serve up from the host header, you don't need a rule to handle this. BIG-IP will pass the headers and original request unmodified by default.

     

     

    However, this is only true if the sites are not SSL, because there is no way to have multiple SSL certs attached to the same IP (wildcards aside). Further, an iRule won't help because you have to decrypt before the iRule processes, and to decrypt you have to use a cert. So if SSL is involved, you will need to use separate IP's.

     

     

    Denny
  • If I am mis understanding your question I apologize. What you could do is for each application lets say aap1 through app7 you could setup different pools. If the url is the same whether http or https really doesn't matter. You Irule would then say if the uri contains /app1 then go to pool app1pool then /app2 go to apppoll2 and so on. As long as the url is the same you would terminate the ssl connection on the F5 and decrypt the traffic read the content to contain a string for each app "Provided by the developers who requested all 7 of these apps go to one VIP" then forward to the coorsponding pool. Seems relativly eay in concept. You might want to wait for someone with more experience to look this over but this could get you started. So you rule would look somethiing like this:

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::uri] contains "app1"} {

     

    pool app1pool

     

    }

     

    elseif { [HTTP::uri] contains "app2"} {

     

    pool app2pool

     

    }

     

    elseif { [HTTP::uri] contains "app3"} {

     

    pool app3pool

     

    }

     

    elseif { [HTTP::uri] contains "app4"} {

     

    pool app4pool

     

    }

     

    elseif { [HTTP::uri] contains "app5"} {

     

    pool app5pool

     

    }

     

    elseif { [HTTP::uri] contains "app6"} {

     

    pool app6pool

     

    }

     

    else {

     

    pool app7pool

     

    }

     

    }

     

     

     

  • okay my virtual server is x.x.x.77 the two identical servers that our sharepoint team are running are x.x.x.80/81. These servers are identical and are physically two different servers. On servers 80 and 81 the sites will be created without an ip address and only by the URL. Each server will have the same exact config for failover. All the client wants to do is when traffic comes in on the virtual server .77 to forward this traffic to either 80 or 81. If I do need to do an irule for this I would need to know how to input the data into the irule fields exactly. I am not familiar with irules. I do, on the otherhand,understand how to setup pools and what not. If this is possible your help would be appreciated.
  • As Denny said, if your web servers host the exact same content you shouldn't need a rule for this. Just configure a pool that contains the two servers and a virtual server that points to the pool. You may need to enable Snat Automap on the VIP if the clients are on the same subnet as the web servers or if the web servers don't have the BIG-IP as their default gateway.

     

     

    This load balancing configuration should be fairly simple to test. If you run into any issues where you think a rule might help, repost here.

     

     

    If you have questions on configuring the pool or VIP, check the configuration guide for your version on AskF5.com or contact support. They should be able to help with non-rool related questions.

     

     

    Thanks,

     

    Aaron
  • Noted...What if my VIP .77 already has a two web servers .78/.79 hosting one sharepoint service. Now our same customer wants to use .77 as the virtual server and add two more servers .80/.81. On .80/.81 they want to host 7 websites maybe more. Since they want to use the same virtual server shouldn't there be an irule? I am really new at this so please bare with me. It would be great if this customer had a new ip for their virtual server. The problem is IP's are limited. Maybe this will help a bit more and hopefully someone can point me in the right direction if you haven't already.
  • If the web servers each have the same content for all applications, you wouldn't need a rule. The web server is performing the HTTP Host header inspection when a request comes in to determine which application or "virtual server" on the web server to pass the request to.

    If at some point you want to add more web servers which don't all serve content for every application the VIP is configured to load balance for, you would need to use a rule. You would want to configure one pool for each application and configure each web server that answers for one particular application. For example, you would have a pool each for app1, app2 and app3. If one web server answers for app1 and app2, you would add it as a node to both the app1 pool and app2 pool. If there was another web server that answered for app2 and app3, you would add it to the app2 pool and the app3 pool. Then you could use a rule on the BIG-IP which inspects the HTTP host header and selects the corresponding pool.

    I think the latter option is what you're trying to address. The rule for that would look like:

    
    when HTTP_REQUEST {
       if { HTTP::host == "app1.example.com" }{
          pool app1_pool
       }
       elseif { HTTP::host == "app2.example.com" }{
          pool app2_pool
       }
       elseif { HTTP::host == "app3.example.com" }{
          pool app3_pool
       }
       else {
          pool default_pool
       }
    }

    If you have a lot of different hosts to look for you would want to consider using a switch statement to evaluate the Host header value.

    The pool configuration would look something like this:

    pool app1_pool {

    member 10.0.0.1:http

    member 10.0.0.2:http

    }

    pool app2_pool {

    member 10.0.0.1:http

    member 10.0.0.3:http

    }

    pool app3_pool {

    member 10.0.0.2:http

    member 10.0.0.3:http

    }

    Does this cover what you were asking about?

    Aaron
  • ok. I have one virtual server .77. I am currently running one pool sps_pool with nodes .78/.79 in this pool. On .78/.79 there is only one web service running. .78 is the main server and .79 is an exact image of .78.

     

     

    Now the same customer wants to throw 2 more servers .80/.81 into the mix. On these servers they will run a minimum of 7 websites. They will be using the same virtual server .77 for these sites. In their iis config they are only using the URL name to address these different websites. One, do I need an Irule to point all of these different websites coming in from .77 to differentiate between the first pool that is working correctly sps_pool and the new pool for .80/.81. Or do I need to just create a new pool and throw the two new nodes into this pool. Will the big-ip beable to direct these URL's to the correct server? I am getting more lost. I have talked with F5 and gone out and read the documentation on irules and everything that has to do with sharepoint and setting it up. I don't understand irules and I do not uderstand where I would need to place my host header information in an irule. I am completely retarded when it comes to this. If anyone wants you can call me directly at 229-291-7622
  • If all 4 servers can serve up all 7 websites then just put them all in the same pool and point the .77 virtual to it, no rule required. If not, then yes, you will need a rule as Aaron described in his last post if you want to send some sites to one pool and other sites to another pool.

     

     

    You may also wish to contact consulting@f5.com if you need more hands-on assistance.

     

     

    Denny