cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse proxy

SOLVED
mxs57
Occasional Contributor

Reverse proxy

Dear all,

 

Currently we are using apache in order to make reverse proxying. But recently, chief would like to test ( and probably using stingray to replace apache ), so is Stingray could make Reverse proxy and if yes how can we deploy this solution?

 

Best regards,

Mxs57.

1 ACCEPTED SOLUTION

Accepted Solutions
ydelmont
Occasional Contributor

Re: Reverse proxy

Hi,

If I understand well what you want to do, the simplest way to transcript your example ( ProxyPassReverse /xxx/ http://y.y.y.y/) would be :

1. Create a vserver for listening to requests (and perhaps a Traffic IP too depending on your environment...)
2. Create a pool with as backend node y.y.y.y:80 (name it for example xxx-pool)
3. Create a TScript rule with the code bellow :
# Select the y.y.y.y server if path matches /xxx/*
$path = http.getPath();
If ( string.startsWith($path, "/xxx/")) pool.select("xxx-pool");

Feel free to ask for more help if this is not clear for you, even off list if you prefer ! Smiley Wink

Regards,

Yannick

View solution in original post

9 REPLIES 9
ydelmont
Occasional Contributor

Re: Reverse proxy

Hi,

 

Stingray traffic manager is a reverse proxy and you do not have to activate anything to make it act as this.

 

That means it receives TCP connection from the client, read the request, open a new TCP connection to a backend server and relay server's reply in order to deliver the service.

 

In that way it acts exactly as Apache when configured as a reverse proxy.

But obviously, Stingray is a lot more powerfull (and simple to configure) than Apache ! Smiley Wink

 

I can contact you off list if you want more advises on how to deploy it.

 

Regards,

 

Yannick 

mxs57
Occasional Contributor

Re: Reverse proxy

Hello,

 

Thank for your answer. I know Stingray is acting as reverse proxy, but I don't understand how. I will explain, Apache works as reverse proxy you make configuration as:

 

ProxyPass                /xxx/ http://y.y.y.y/

ProxyPassReverse /xxx/ http://y.y.y.y/

 

And after you type http://myrp/xxx/ and you have the result.

 

How can we translate this into Stingray?

 

Best regards,

Mxs57.

ydelmont
Occasional Contributor

Re: Reverse proxy

Hi,

If I understand well what you want to do, the simplest way to transcript your example ( ProxyPassReverse /xxx/ http://y.y.y.y/) would be :

1. Create a vserver for listening to requests (and perhaps a Traffic IP too depending on your environment...)
2. Create a pool with as backend node y.y.y.y:80 (name it for example xxx-pool)
3. Create a TScript rule with the code bellow :
# Select the y.y.y.y server if path matches /xxx/*
$path = http.getPath();
If ( string.startsWith($path, "/xxx/")) pool.select("xxx-pool");

Feel free to ask for more help if this is not clear for you, even off list if you prefer ! Smiley Wink

Regards,

Yannick

mxs57
Occasional Contributor

Re: Reverse proxy

Hi,

 

Thanks for response, I will try this solution and will give you feedbacks.

 

Best regards,

Mxs57.

mxs57
Occasional Contributor

Re: Reverse proxy

Hi,

 

Thanks for your answer I tried it and it is working fine. Now I am trying to make content rewriting but I am encountering some issues due to trafficscript configuration. I would like to rewrite all link ( href, src, action ), because we got some application with absolute link and they are not working.

 

I am trying to solve this issue with string.regexmatch but If I am doing this in a while loop the appliance failed. Am I on the right way?

 

Best regards,

mxs57.

owen
Frequent Contributor

Re: Reverse proxy

Hi mxs57,

 

You could perhaps try 'string.replaceAll( $body, "oldtext", "newtext" )' as a simpler alternative to a regex replacement.

 

Nevertheless, a rule should not cause the traffic manager to 'fail'.  In the worst case, a rule may get stuck in an endless loop, and Stingray will abort the rule after trafficscript!max_instr steps to prevent this.

 

Please share your code, and example of the text you need to process, and we'll advise (or raise it with our support team)

 

Best regards

 

Owen

owen
Frequent Contributor

Re: Reverse proxy

Also, check out this article: Getting Started - Load-balancing to a website using Stingray Traffic Manager. There are a few gotchas that you can encounter when using a reverse proxy like Stingray that this article explains.

regards

Owen

bryceee
Not applicable

Re: Reverse proxy

Okay, I am pretty new to Stingray, used to working on an ISA 2006 Proxy.

I want to reverse proxy a test website, which is running on IIS 7. There are 3 websites on the server.

Using the wizard, I have done the following.

Virtual Server

Name: TestWebsite

Enabled: Yes

Internal Protocal: HTTP

Port 80:

Default traffic pool; TestWebsite

Listening on; All IP Addresses

Pools

Name: TestWebsite

Nodes: Testwebsite.website.com (is this supposed to be the website url or the machines host name?)

When I navigate my stingray address http://10.41.30.10. I get the default IIS 7 page. Even if i change the port reference I get a 404 error.

What am I doing wrong?

owen
Frequent Contributor

Re: Reverse proxy