cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
534
Views
0
Helpful
2
Replies

directing traffic to specific server based on URL

gaspolgas
Level 1
Level 1

I've got 2 servers in a server farm on round robin load balancing set up. Right now, it load balances requests to www.abc.com. I would like all requests for www.abc.com/admin to go to server A all the time. What's the best way of accomplishing this? I've tried setting up stickiness with no luck so I'm not sure if that's the right approach. Thanks.

2 Replies 2

First create class-map with your url:

class-map type http loadbalance match-any ABC
  3 match http url /admin.*

Next create new server-farm with only one server:

serverfarm host SERVERFARM.SERVER1
  rserver RSERVER.ONE 80
    probe PROBE.ONE
    inservice

Next modify your policy-map type load-balance:

policy-map type loadbalance first-match POLICY.LB
  class ABC
    serverfarm SERVERFARM.SERVER1
  class class-default
    sticky-serverfarm STICKY.SERVERFARM.ONE

Everything what is matched by Class-map will be forwarded to Serverfarm. Simple and very scalable.

Thank you! That worked for me.