Redirect/rewrite on CSM? How can I accomplish?

Unanswered Question
Sep 24th, 2007

Looking to help out a developer here.

Right now all pages http://pyxis.constellation.com:80/* go to a single page http://pyxis.constellation.com:8046/.

We want to rewrite the URL changing the port so that http://pyxis.constellation.com:80/whatever goes to http://pyxis.constellation.com:8046/whatever.

http://pyxis.constellation.com:80/whatever --> LB --> http://pyxis.constellation.com:8046/whatever

The user needs to see only port 80.

Can this be done on the CSM?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Martin Kyrc Mon, 09/24/2007 - 13:41

If I understand, you mean virtual server is listening on the port 80, but real http server is listening on different port. right? Yes, it's possible using port definition on the server farm by definition real server.

martin

adamkeller Mon, 09/24/2007 - 14:44

Here is an example:

He wants it so that if I go to http://pyxis.constellation.com:80/apdet.html that it will redirect to http://pyxis.constellation.com:8046/apdet.html

Or if I go to http://pyxis.constellation.com:80/apscript.html it will then go to http://pyxis.constellation.com:8046/apscript.html

Basically any request will go from 80 to 8046 and leave the requested page in the url string.

map PYXIS_80 url

match protocol http url http://pyxis.constellation.com:80/*

!

policy PYXIS_REDIRECT

url-map PYXIS_80

serverfarm PYXIS-REDIR

!

serverfarm PYXIS-REDIR

nat server

no nat client

redirect-vserver PYXIS-REDIR

webhost relocation http://pyxis.constellation.com:8046

inservice

!

serverfarm PRD-PYXIS

nat server

nat client NATPOOL1

real 10.103.25.110

health probe PRD-PYXIS-01

inservice

real 10.103.25.112

health probe PRD-PYXIS-02

inservice

!

vserver PRD-PYXIS

virtual 10.228.1.107 tcp 0

serverfarm PRD-PYXIS

sticky 28800

replicate csrp connection

persistent rebalance

inservice

!

vserver PRD-PYXIS-REDIR

virtual 10.228.1.107 tcp www

serverfarm PYXIS-REDIR

persistent rebalance

slb-policy PYXIS_REDIRECT

inservice

!

Gilles Dufour Tue, 09/25/2007 - 03:58

the first question is : do we really need to send a redirect ???

If the new site is also on the CSM, why not simply transparently do port nating.

So the client believes it is using port 80, but the csm port nat 80 into 8046.

In this case, all you have to do is specified the port in the serverfarm.

ie:

serverfarm PRD-PYXIS-8046

nat server

nat client NATPOOL1

real 10.103.25.110 8046

health probe PRD-PYXIS-01

inservice

real 10.103.25.112 8046

health probe PRD-PYXIS-02

inservice

!

and use this serverfarm in your vser PRD-PYXIS-REDIR.

Now if for some reasons, you really need a redirect, you can do the following the keep the path :

serverfarm PYXIS-REDIR

nat server

no nat client

redirect-vserver PYXIS-REDIR

webhost relocation http://pyxis.constellation.com:8046/%p

inservice

Gilles.

Actions

This Discussion