Reverse proxy by using URL Redirect

The URL Redirect feature of SafeSquidâ„¢ is a very popular feature and should be used with some imagination and logic to get the best results.

Reverse proxy by using URL Redirect

Postby rsimons » Tue Nov 15, 2005 5:18 pm

Hi Guys,

I am trying to use SafeSquid to give access to a webmail server behind a firewall.

I try to do this with URL Redirect:
URL http://www.mydomain.com/webmail should go to http://internalip.

Can anyone shed some light on the regular expression and the resulting string ?? :shock:

What happens to the rest of the session (URL grows with parameters in the conversation with the webmail-server)

How about authentication ??

Can it be done with https as well??

Can I expose other interactive sites through the same safesquid ??

I have searched around but couldn't find anything except the reverseproxy example.....
rsimons
 
Posts: 24
Joined: Thu Aug 25, 2005 3:43 am
Location: Heerlen

Re: Reverse proxy by using URL Redirect

Postby Tech Support One » Wed Nov 16, 2005 12:13 pm

Hi

Normally If you want to setup reverse proxying for your web server
Let us say your webserver is ruunig on port 80
Now to setup reverse proxying you will make your web server Listen on some other port let us say port 8000
and on the port wherein your web server used to listen you will make safesquid to listen on this port

So Make your web server to listen on port 8000 and safesquid on port 80

Now you will require a URL Redirect entry as shown below

Code: Select all
Enabled   true
URL   http://my.webserver.com/(.*)
Redirect   http://my.webserver.com
Port   8000
302 redirect   false
Options   encode,decodebefore,decodeafter
Applies to   url


wherein my.webserver.com is the name of your web server that you will run on port 8000
Now very request coming to your web server will pass thru the proxy

Is this how you are planning to use reverse proxying
Let us know details about the same;
Tech Support One
 
Posts: 1458
Joined: Sat Aug 21, 2004 4:43 pm
Location: India

Postby rsimons » Wed Nov 16, 2005 3:09 pm

Hi Prasanna,

We try to do the following:

We have a DMZ with the reverse-proxy and our webservers are on a Backlan behind a firewall.

We want to point all traffic to the reverse-proxy and split all incomming traffic to the various web-application servers. Let me give an example:

User (on internet) types : http://www.mydomain.com/webmail

Proxy converts it to :
http://webmail.internal.lan

Now my questions:

Am I correct that when I use multiple regular expressions I can (or must) refer to then in the result URL?

What happens to the rest of the URL sent by the user in the session, is this passed through to the web application server during the session ??

What happens if the application uses authentication with challenge and responce ??

What must I do to enable the same for https port 443 ?? Can I get SafeSquid to listen to both port 80 AND port 443 ??

Can I use PAM authentication with reverse proxy ??

I know, al lot of questions, but maybe the answers wil be helpfull for others as well... :wink:

René
rsimons
 
Posts: 24
Joined: Thu Aug 25, 2005 3:43 am
Location: Heerlen

Postby rsimons » Wed Nov 16, 2005 3:55 pm

A little follow-up:

The redirect seems to work a little but not completely....

I can see in the logging that SafeSquid redirects to the web application, BUT

it tells me "header: error reading header from xxx.xxx.xxx.xxx (This is the application server)

What is happening ??

What do the encode setting do ?? What does the header, url or both setting do ??

The websites begin with asking authentication... maybe thats the problem ???

René
rsimons
 
Posts: 24
Joined: Thu Aug 25, 2005 3:43 am
Location: Heerlen

Re: Reverse proxy by using URL Redirect

Postby samvirtual » Thu Jan 08, 2009 7:59 pm

How tried to setup a reverse proxy.

1. safesquid listens on the outside interface to
http://www.domain.com port 80

2. Real webserver at the inside LAN listens to
http://realwebserver.com port 80

3. incoming http requests for http://www.domain.com must redirected to http://realwebserver.com

I tried the following in safesquid which does not work.

URL Redirect

Enabled true
URL http://www.domain.com
Redirect http://realwebserver.com
Port 80
302 redirect true
Options encode
Applies to both

The test browser I use is IE and NO proxy is configured

Question : Why it doesn't work and how can I fix it?
samvirtual
 
Posts: 4
Joined: Wed Dec 10, 2008 4:23 pm

Re: Reverse proxy by using URL Redirect

Postby satish7619 » Sat Jan 10, 2009 12:04 pm

Hello,

Safesquid should listen on port 80 on the external interface . I would recommed configure apache to listen on 127.0.0.1 on port 100. then create a rule url redirect rule .also in your /etc/hosts you have to insert this line

/etc/hosts

127.0.0.1 realwebserver


Enabled true

URL http://domain.com(.*)

Redirect http://realwebserver$1

Port 100

302 redirect false

Applies to url
satish7619
 
Posts: 1146
Joined: Thu Apr 15, 2004 3:55 pm
Location: India


Return to URL Redirect

Who is online

Users browsing this forum: No registered users and 1 guest

cron