Webhost-redirection and http rewrite?

Unanswered Question
Mar 31st, 2010

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?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 0 (0 ratings)
Sean Merrow Sun, 04/04/2010 - 08:38

Hello,

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

Thanks,

Sean

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

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://sefags155:7002/ematrix

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

//HB

Sean Merrow Mon, 04/05/2010 - 07:22

Hello,

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
    inservice

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 192.168.10.203 tcp eq www

policy-map type loadbalance first-match PM-HTTP-DOT-203
  class ENOVIAPROD
    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.

Sean

Actions

Login or Register to take actions

This Discussion

Posted March 31, 2010 at 10:34 AM
Stats:
Replies:3 Avg. Rating:
Views:413 Votes:0
Shares:0
Tags: No tags.

Discussions Leaderboard

Rank Username Points
1 1,551
2 369
3 333
4 228
5 212
Rank Username Points
5