01-26-2013 10:47 AM
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
01-27-2013 03:18 AM
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 ?
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide