Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Reverse Proxy for IIS Site on Same Host Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
cjconrad
Newbie
Newbie


Joined: 13 February 2005
Location: United States
Online Status: Offline
Posts: 14
Posted: 11 August 2008 at 8:16pm | IP Logged Quote cjconrad

I have had prior releases of ISAPI (2.6, 2.8 and now 3.x), and got some of the features to work -- others I just couldn't spend more time on, and let it ride (I am sure the product could do what I needed, but I just couldn't figure it out in reasonable time).

No I just upgraded to the latest Pro version, and I really want to get it all working this time. I am likely to ask some "stupid" questions, so please be patient with me.

First, I want to do what I think is a simple Reverse Proxy. I have Windows 2003 Server, IIS 6, with two internet-registered domains coming to the server (via my router). I have established a separate IIS Web Site for each of these domains, both under the same IIS on the server, with each using a different port, of course. I want ISAPI-RW to use the headers to determine which site to proxy.

If one site is "site1.com", using port 850, then the statements in httpd.conf I use are:

RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?site1\.com$ [NC]
RewriteRule ^/?$ http://127.0.0.1:850 [NC,P]

This works well to show the main page, but the images aren't loading consistently. It's odd, but some (not all) load in Firefox, while others (not all) load when using IE. In any case, it appears that my rules aren't properly proxying the subfolder/filenames.

I am sure this is something simple for those that understand the matching syntax (it is very foreign to me!). Thank you in advance for any assistance.

(When I have this resolved, I will move on to the next challenge -- there are three in total, though the solution to the above might address one of those).

Craig
Back to Top View cjconrad's Profile Search for other posts by cjconrad
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4842
Posted: 12 August 2008 at 5:07am | IP Logged Quote Anton

Please try to use this config:

RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?site1\.com$ [NC]
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^(.*)$ http://127.0.0.1:850/$1 [NC,P]


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
cjconrad
Newbie
Newbie


Joined: 13 February 2005
Location: United States
Online Status: Offline
Posts: 14
Posted: 12 August 2008 at 2:05pm | IP Logged Quote cjconrad

Thanks for the quick response. At first, it didn't work. Then I realized that your recommendation was IN ADDITION TO what I already had. With these additions, it loads the correct JPG files fine in both Firefox and IE, but only Firefox loads the GIF file identified in the HTML.

Any further changes I can make to support the GIFs (or anything else that a site might commonly use)? Isn't there a simple way to proxy EVERYTHING that is destined for "site1.com" to "127.0.0.1:850", regardless of anything appearing after the ".com" (e.g. folders, files, parm strings, etc)?

Thanks in advance ....     Craig
Back to Top View cjconrad's Profile Search for other posts by cjconrad
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4842
Posted: 13 August 2008 at 5:09am | IP Logged Quote Anton

Here's the rule to proxy everything:

RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?site1\.com$ [NC]
RewriteRule ^(.*)$ http://127.0.0.1:850/$1 [NC,P]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
cjconrad
Newbie
Newbie


Joined: 13 February 2005
Location: United States
Online Status: Offline
Posts: 14
Posted: 13 August 2008 at 10:32am | IP Logged Quote cjconrad

Anton,

Thank you very much -- that seems to work (and is much simpler). I am still having a difference in loading GIF files between Firefox and IE, but I don't know if it relates to ISAPI-RW or not. For now, I am satisfied with this issue.

This seems like something that would be commonly needed by your customers, and should be a highlighted example (I didn't see it).

Thanks again ... Craig
Back to Top View cjconrad's Profile Search for other posts by cjconrad
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum