Forum Discussion

Rob_78395's avatar
Rob_78395
Icon for Nimbostratus rankNimbostratus
Nov 07, 2012

Simple Reverse Proxy

Hello - I have 3 different URLs pointing to the same Virtual Server on LTM VE 11.2.1 so a dig for each looks like:

 

example1.com - 10.0.0.1

 

exmple2.org - 10.0.0.1

 

example3.net- 10.0.0.1

 

 

I want:

 

example1.com to be proxied to pool.192.168.0.1

 

exmple2.org to be proxied to pool.172.16.10.1

 

example3.net to be proxied to pool.10.200.200.1

 

 

I have 3 URLs to the same Virtual Server now but will soon be adding 50 more and each URL will be proxied to its own pool so I am looking for the simplist way to add new URLs over the next few weeks. Thoughts?

 

  • You can can use a Data Group for this with the value for each domain being the Pool name required, it'll be very easy to update too.

    
    when HTTP_REQUEST {
     if { [set newpool [class match -value [HTTP::host] equals host-data-group ]] ne ""}
     { pool $newpool }
    }
    
  • Thanks for the feedback! Im having trouble making this work. What would my Data Group look like?

     

  • In tmsh it would look something like this (which probably makes it look more complicated that it is;

    
    ltm data-group internal host-data-group {
        records {
            example1.com {
             pool-1
            }
            exmple2.org {
             pool-2
            }
        }
        type string
    }
    

    Menu path: Local Traffic > iRules > Data Group List > Create > Type: String

    Add records with the domain name as the String and the Pool name as the Value.

  • Nice work Steve. You might want to either add a pool selection in an else clause or use a OneConnect on the virtual server to ensure reach request is sent to the correct pool:

     

     

    https://devcentral.f5.com/wiki/AdvDesignConfig.ONECONNECT.ashx

     

     

    Aaron
  • You guys are awesome! I have OneConnect and so far the lab setup is now working smoothly. I'm excited to see how it reacts to 20-30 new URLs next week.

     

     

    Thanks again!!

     

    Rob