cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1083
Views
0
Helpful
3
Replies

Webhost-redirection and http rewrite?

hborg
Level 1
Level 1

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?

3 Replies 3

Sean Merrow
Level 4
Level 4

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

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

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

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: