This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Setting up a Reverse Proxy
Author
Message |
Xhernz
Newbie


Joined: 25 September 2011
Location: United States
Posts: 3
Posted: 03 October 2011 at 12:58pm

Hello everyone:
I need to pass requests for a domain/url/host from one server to another and I've been told that what I need is IIS working as a reverse proxy. This is something I've never configured and would appreciate some help.

My business network setup is as follows:

Server A: IIS 6.0 with ISAPI_rewrite 3. It has an internal IP (192.168.1.2) and an external IP (virtual server setting on router) It is a webserver that responds to port 80 and is currently live.
Server B: IIS 7.5. It has an internal IP (192.168.1.3) but no external IP. It is also a webserver that I intend to use to replace Server A. But it is not visible or accessible on the internet. Since acquiring another IP address is not an option, I need help to set up the following:

1. I'd like to have Server A pass all requests for a domain (which is already registered and functioning) to Server B which is already configured to respond. Both ways, in and out.
2. No one will/should see any changes to the web address.
2. I have to use authentication (usernames and passwords) on Server B. This is occasional, like when I need to access my dashboard with my admin account username and password in the website hosted by Server B, but it must work.
Since I believe this is a straight pass-thru and not exactly a rewrite setting, what would be the best way to do this with ISAPI_Rewrite 3.0?

Since I've never done this, please be specific, like the exact code I need to write(I'll just fill in the specific settings of my network), in which file I must place the code, and what configuration I need to have on Server A IIS6.0 to enable this.

Thank you so much
Xavier

Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 04 October 2011 at 7:26am

Hello Xavier,

Here's the RewriteProxy directive, you may find all useful information here.
There's also a small example in the examples section that shows how to use RewriteRule directive
with

flag instead of RewriteProxy.

Regards
Andrew

Back to Top
 
Xhernz
Newbie


Joined: 25 September 2011
Location: United States
Posts: 3
Posted: 08 October 2011 at 11:46am

Hi Andrew:
I've already looked and tried to come up with something that would work.
However like I said, I've never done this before and feel lost.

In the examples I don't see anything that clearly shows how to point the domain/hostname to an internal webserver. Like I stated it'll be the same domain from one webserver to another, one faces the web the other is internal with no outside IP.

I only see this:
RewriteEngine On
RewriteBase /
RewriteProxy ^folder/(.*)$ http://www.google.com/$1
Which apparently means (please correct me if I'm wrong) that the contents of the folder/ from the live(on the web) webserver will be redirected to Google's homepage.
Well I tried this by creating a site with an empty folder and the correct domain name in IIS. I then entered the code in the httpd.conf file to do the redirection to the same domain name that the internal webserver is configured to respond to. But I'm getting a Directory Listing Denied error message.

So I don't really know how to structure this RewriteProxy directive and would really appreciate your help with a specific example of how this should look.

Thank you
Xavier



Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 11 October 2011 at 3:35am

Hello,

I would stick to the rule like(this will force proxy for any request to be proxied to google):
Code:
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP:Host} ^testing\.domain\.com$ [NC]
RewriteProxy .? http://www.google.co.uk [NC,P]

NOTE: google.com forces redirect instead of proxying, google.co.uk will give you proxying


"Directory Listing Denied" is an error, which can be eliminated by providing sufficient permissions for the site-folder.
Please, follow the article

Regards
Andrew
Back to Top
 
Xhernz
Newbie


Joined: 25 September 2011
Location: United States
Posts: 3
Posted: 13 October 2011 at 1:32pm

Thanks so much Andrew.
The settings worked well so I'm getting the site from the internal server to load.
But now I'm experiencing another problem which makes the site unusable:all of the css based styling and the images are not loading.

I checked the FAQ and I realize that apparently it's some sort of path issue.
Since the website is a dynamic cms, based on ASP.NET, the image paths are created and loaded by the program (in this case DNN6).

Using firebug I checked to see what the path was to these images and I found this structure:
src="/Portals/_default/Skins/MBSI/images/image.gif
DNN separates child websites into Portals and numbers them up (0,1,2...)
I only have one portal/website and what's surprising to me is that the  first folder in the path (Portals) is right in the root of the site (IIS physical path) where the default.aspx file is located. So I'm confused as to why the images or the css sheets are not loading.

Could something in the RewriteProxy setting I created be causing this?
This is what I have at the moment (with the specific host/website that is getting proxied):
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Host} ^maisonave\.com$ [NC]
RewriteProxy .? http://maisonave.com/ [NC,P]

(Please note that it wont work for you because the internet DNS settings are not configured to point to my specific webserver yet.)

Again I would appreciate your help with the best way to fix or somehow customize the settings.


Edited by Xhernz - 13 October 2011 at 1:33pm
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 14 October 2011 at 5:05am

Well,

This path issue is applied for both redirects and proxying. You need to have all .css and image link to be in absolute or root-relative format. This will fix the
problem.

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version