Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Redirect/rewrite on CSM? How can I accomplish?

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?

3 REPLIES
New Member

Re: Redirect/rewrite on CSM? How can I accomplish?

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

New Member

Re: Redirect/rewrite on CSM? How can I accomplish?

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

!

Cisco Employee

Re: Redirect/rewrite on CSM? How can I accomplish?

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.

157
Views
0
Helpful
3
Replies
CreatePlease login to create content