cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4588
Views
5
Helpful
8
Replies

ACE class-map match url syntax

adam.zinser
Level 1
Level 1

Can someone help me with the string that would match a url with no path specified?  For instance; user types "https://outlook.domain.net" into their browser and I want the ACE to redirect that request to https://outlook.domain.net/owa".


  2 match http url oulook\.domain\.net\

1 Accepted Solution

Accepted Solutions

I set up a similar thing for our SAP portal - if the original request is just a '/' at the end with no path after.

class-map type http loadbalance match-any rootURL
  description **If the URL is root then redirect**
  2 match http url \x2F

Perhaps this is what you are after?

Cheers

Cameron

View solution in original post

8 Replies 8

shday
Level 1
Level 1

I want to do something similar.

I want a class-map that will match http://domain.com so I can redirect those requests to a link page, but I want everything going to http://domain.com/any_path to be sent to a serverfarm.

I think the class-map would look something like this,

class-map type http loadbalance

2 match http url domain\.com.*

3 match http url domain\.com\.

Am I even close.

Pablo
Cisco Employee
Cisco Employee

Adam and Shday,

I'll give you a hand on this =)

Adam we can solve your problem only if you're doing SSL offloading on the ACE as the layer 5 information that needs to be checked is being sent encrypted.

In case SSL termination is configured then the configuration would be like this:


rserver redirect OWA
  webhost-redirection https://%h/owa 301
  inservice

serverfarm redirect OWA
  rserver OWA
    inservice

class-map type http loadbalance match-any OWA 
2 match http header Host header-value "outlook.domain.net"

policy-map type loadbalance first-match OWA
class OWA
  serverfarm OWA
class class-default
  serverfarm Backend
*******************************************************************************

Shday yours is pretty much the same but you need to decide if class-default needs
to be in place:

rserver redirect Domain
webhost-redirection http://%h/any_path 301
inservice

serverfarm redirect Domain
   rserver Domain
     inservice

class-map type http loadbalance match-any Any
2 match http url /.*
class-map type http loadbalance match-any Domain
2 match http header Host header-value "domain.com"
policy-map type loadbalance first-match Domain
class Any
  serverfarm Backend
class Domain
  serverfarm Domain

*******************************************************************************
HTH
__ __
Pablo



I tried this class-map and policy.  I get to my backend server,

but I can't get anything to hit the redirect.  Everything is matching on the first class-map

I am using http://domain.com in my browser and my header class-map looks like this,

class-map match-any vip-of-domain

2 match virtual-address 206.201.79.20 tcp any

class-map type http loadbalance match-any any-url

2 match http url /.*   ---------------- doesn't this mean any url


class-map type http loadbalance match-any domain

2 match http header Host header-value domain.com

policy-map type loadbalance first-match domain-lbpl

class any-url

serverfarm backend-serverfarm

class domain

serverfarm domain-redirect

policy-map multi-match domain-mmpl

class vip-of-domain

loadbalance vip inservice

loadbalance policy domain-lbpl

I think its matching based on the /.* and never gets to the header class-map.

This causes an infinite loop.  I've run through several configurations that have this same flaw in them.  I need a configuration that explicitly specifies that the redirect should only happen when there are no characters in the path.  I attempted the url match with both \r and \n, also with no luck.

Adam, Shday,

My bad please try config below:

rserver redirect OWA
  webhost-redirection https://%h/owa 301
  inservice

serverfarm redirect OWA
  rserver OWA
    inservice

class-map type http loadbalance match-any Outlook
2 match http header Host header-value "outlook.domain.net"

class-map type http loadbalance match-any OWA
2 match http url /owa.*


policy-map type loadbalance first-match OWA
class OWA
  serverfarm Backend
class Outlook
  serverfarm OWA

*****************************************************************

rserver redirect Domain
webhost-redirection http://%h/any_path 301
inservice

serverfarm redirect Domain
rserver Domain
  inservice

class-map type http loadbalance match-any Any
2 match http url http://domain.com/.*

class-map type http loadbalance match-any Domain
2 match http header Host header-value "domain.com"

policy-map type loadbalance first-match Domain
class Any
  serverfarm Backend
class Domain
  serverfarm Domain

Regards.

__ __

Pablo

still doesn't work.

I put http://cranapple.farms.com and its redirected.  If i put http://cranapple.farms.com/florida I get redirected.

I only want to be redirected if I see http://cranapple.farms.com

I set up a similar thing for our SAP portal - if the original request is just a '/' at the end with no path after.

class-map type http loadbalance match-any rootURL
  description **If the URL is root then redirect**
  2 match http url \x2F

Perhaps this is what you are after?

Cheers

Cameron

Cameron:   TAC gave me "2 match http url /" but I went ahead and threw your match in as well to test.  Same results; both work.  Odd thing is that when I put in the root URL I get redirected to my OWA page.  If I then enter the root URL again into the same window, it takes me to the default IIS page.  I'm not too worried about it as I don't see this as a likely user encounter, but if you've got any thoughts on why that would happen....  Thanks for your help.