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 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.....
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


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
Port   8000
302 redirect   false
Options   encode,decodebefore,decodeafter
Applies to   url

wherein 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 :

Proxy converts it to :

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:

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 (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 ???

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 port 80

2. Real webserver at the inside LAN listens to port 80

3. incoming http requests for must redirected to

I tried the following in safesquid which does not work.

URL Redirect

Enabled true
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?
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


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

/etc/hosts realwebserver

Enabled true


Redirect http://realwebserver$1

Port 100

302 redirect false

Applies to url
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