A10 vThunder ADC/SLB - Redirection based on URL

wtegga10wtegga10 Member

Hello,

I will try to do more research to see if this was already covered in another post, but so far haven't been able to find exactly what I'm looking for.

Is it possible to do a redirect based on which URL the end user goes to for whats described below? Or is this completely wrong and I should be looking for an alternative solution?

Say you have an internal application you want to pass through. So you have the following

virtual server 10.1.1.10 with port 443

  • Now based on what URL they go to will determine the farm they access.
  • https://10.1.1.10/website will use farm 1
  • https://10.1.1.10/website/purchasing will use farm 2
  • https://10.1.1.10/engineering will use farm 3

I probably have this all wrong, but I'll keep working on it to see what I can come up with.


Thanks!

Comments

  • dquinndquinn Member, A10ers

    You should be able to accomplish this with a http template, this is in the following guide

    https://documentation.a10networks.com/ACOS/600x/ACOS_6_0_0-P2/pdf/Application_Delivery_Controller.pdf

    here is an example from the ADC config guide

    ACOS(config)# slb template http urlswitch

    ACOS(config-http)# url-switching starts-with /abc service-group sg-abc

    ACOS(config-http)# url-switching starts-with /123 service-group sg-123

    ACOS(config-http)# exit

    ACOS(config)# slb virtual-server vs1 1.1.1.1

    ACOS(config-slb vserver)# port 80 http

    ACOS(config-slb vserver-vport)# template http urlswitch

    ACOS(config-slb vserver-vport)# service-group sg-abc

  • wtegga10wtegga10 Member

    Sorry for the dumb post. I think I got it figured out. The only thing I'm not sure of is the whole starts_with option. So clearly if we do a starts_with "website" it'll be redirected right away not allowing it to hit the purchasing page. Sure I could reorder it, but I want to think of another way to do it.


    when HTTP_REQUEST {

     if {[HTTP::uri] starts_with "/website"} {

      pool farm1

     } elseif {[HTTP::uri] starts_with "/purchasing"} {

      pool farm2

     } elseif {[HTTP::uri] starts_with "/engineering"} {

      pool farm3

     }

    }

  • wtegga10wtegga10 Member

    Awesome! Thats exactly what I was looking for. Way better than what I was about to do hahaha.


    Thanks again!

Sign In or Register to comment.