Webhost-redirection and http rewrite?

Unanswered Question
Mar 31st, 2010
User Badges:

I have a customer that has an URL, for example www.test.com that points to different tomcat instances using other url’s, therefor I have used webhost-redirect, this works fine. But, the customer want this redirect not to be visible for the user, how is this possible? I was thinking that an action-list with http insert/rewrite would fix it, but still I haven’t got this to work. First, is it possible to do this? Second, does anyone have a good configuration example for this?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Sean Merrow Sun, 04/04/2010 - 08:38
User Badges:
  • Silver, 250 points or more


It is not clear to me from your description what you are trying to accomplish.  Can you please elaborate on what your requirements are?



hborg Mon, 04/05/2010 - 01:23
User Badges:

OK, I will try to be clear.

The customer make’s a call for the URL http://enoviaprod or someone of the 2 others listed in the left.  This call will be redirected to different hosts using another URL via the webhost-redirect command, see the right URL’s. This works pretty good. The customer wants this redirect to be invisible for the users, meaning that the called URL should be the one visible for the user after the redirect. Can this be done using the http rewrite command?

http://enoviaprod                                          http://sefags154:7001/ematrix, http://sefags155:7001/ematrix, http://sefags154:7002/ematrix, http://sefags155:7002/ematrix

http://enoviaprod/ematrix                            http://sefags154:7001/ematrix, http://sefags155:7001/ematrix, http://sefags154:7002/ematrix,

http://enoviaprod/WebContent                           http://sefags154:7007/WebContent, http://sefags155:7007/WebContent


Sean Merrow Mon, 04/05/2010 - 07:22
User Badges:
  • Silver, 250 points or more


I'm not sure if you can do this.  It looks to me, and correct me if I'm wrong, like you are load balancing a request to http://enoviaprod.com to any one of the URLs on the right.  If this is the case you'd need to be able to rewrite the Host header based on the rserver that is chosen in the load balancing algorithm.  The problem with that is that the Host header rewrite is per serverfarm, not per rserver.

You can rewrite the Host header as follows:

serverfarm host REALS
  probe tcp
  rserver SERVER 7001

action-list type modify http ENOVIAPROD-to-SEFAG
  header rewrite request Host header-value "enoviaprod\.com" replace "sefags154:7001"

class-map type http loadbalance match-all ENOVIAPROD
  2 match http header Host header-value "enoviaprod.com"

class-map match-any HTTP-DOT-203
  2 match virtual-address tcp eq www

policy-map type loadbalance first-match PM-HTTP-DOT-203
    serverfarm REALS
    action ENOVIAPROD-to-SEFAG
  class class-default
    serverfarm REALS

If you don't need the :7001 after the sfags Host header, then you could to the action-list as follows:

action-list type modify http ENOVIAPROD-to-SEFAG
   header rewrite request Host header-value "enoviaprod\.com" replace "sefags154"

However, the above configuration will always rewrite the header in the same way, regardless of which rserver it goes to.  I'm not sure if this helps or not.



This Discussion