ACE HTTP Header Rewrite

Unanswered Question
Aug 5th, 2010

Hi,

i need help in configuring http header rewrite. i want to take request url: www.cisco.com and rewrite it to www.yahoo.com for example.

what should be the syntax at the action list i am configuring ?

appreciate your help,

Avi.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
litrenta Thu, 08/05/2010 - 11:24

You can't actually rewrite the url portion of the uri, but in your example you are actually looking to rewrite the host header which the ace can do. Here is how you do it:

1. make a parameter map to tell the ace to look at each request for rewrite eligibility:

parameter-map type http rewrite
  header modify per-request

2. Make an action list to do the modification

action-list type modify http host_rewrite
  header rewrite request Host header-value "www.cisco.com" replace "www.yahoo.com"

3. apply the action list to the load balance policy:

policy-map type loadbalance first-match test4
  class class-default
    serverfarm test4
    action host_rewrite

4. call the load balance policy and parameter map in your L4 policy map for the vip class.

policy-map multi-match test5
  class test1
    loadbalance vip inservice
    loadbalance policy test4
    loadbalance vip icmp-reply active
    appl-parameter http advanced-options rewrite

Actions

This Discussion