cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
738
Views
0
Helpful
1
Replies

ACE20 - Simple HTTP Header (URL) Rewrite - Can't Get It To Work

Hello Experts,

I need to carry out a very simple URL rewrite, which according to the Configuration Guide should be VERY simple, but I'm damned if I can get it to work!

So here is the scenario:

I have a VIP configured on the ACE in DNS, it has 2 entries, lets call them:

ace-tl-vip.testlab.com = 10.72.21.10 (Primary DNS Entry)

alias-ace-tl-vip.testlab.com = 10.72.21.10 (Alias DNS Entry)

When the client access the website from their browser, this just type http://alias-ace-tl-vip. The do not need to use a FQDN as DNS suffixing on their PC takes care of that, so they only need to type the 'short' name.

All I would like to do is get the ACE to rewrite their URL (HTTP header) request from being http://alias-ace-tl-vip to become http://ace-tl-vip when it gets passed to the back the backend real servers.

Additionally, I was wondering if the response back from the server could 'rewrite' the URL as seen in the client's browser?

From my understanding, I should just be able to use as simple config like this:

action-list type modify http HTTP_REWRITE_REQ_AND_RESP

  header rewrite both REWRITE header-value "alias-ace-tl-vip" replace "ace-tl-vip"

Then just apply the action to a policy-map:

policy-map type loadbalance first-match TEST-WEB-POLICY-TL

  class class-default

    serverfarm TEST-WEB-FARM-TL

    action HTTP_REWRITE_REQ_AND_RESP

It have tried numerous and various iteration of the header rewrite (including trying 'request', 'response' and 'both') but none of them seem to do anything. I'm suspecting it may be down to the match syntax, as the configuration manual isn't particularly clear about this and assumes you are an expert on expression writing!

I have access the to the webserver access logs and I can see that no matter what I do with the header rewrite, nothing appears to be happening with the request, let alone the response.

I've also had a look a the 'show stats http' on the ACE and it doesn't seem to be attempting to rewrite any HTTP headers.

Can someone suggest where I might be going wrong?

Your help is appreciated.

Cheers,

Dom

1 Reply 1

ajayku2
Cisco Employee
Cisco Employee

Hi,

In the command :

action-list type modify http HTTP_REWRITE_REQ_AND_RESP

  header rewrite both REWRITE header-value "alias-ace-tl-vip" replace "ace-tl-vip"

If you login to ace and do question mark :

ace-1/Admin(config-actlist-modify)# header rewrite both ?

    Enter http header name (Max Size - 255)   <<<< This means you should use the header name >>>>

Try using the header name "host" something like below :

action-list type modify http HTTP_REWRITE_REQ_AND_RESP

  header rewrite both Host header-value "alias-ace-tl-vip" replace "ace-tl-vip"

Also make sure the same is used in multimatch policy.

In HTTP 1.1 URL is represented by HOST header. Something as below.

Host: alias-ace-tl-vip

regards,

Ajay Kumar

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: