cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1473
Views
4
Helpful
1
Replies

ACE HTTP Header Rewrite

aviyoshi10
Level 1
Level 1

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.

1 Reply 1

litrenta
Level 3
Level 3

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: