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: Proxy config problem Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
noremorse
Newbie
Newbie


Joined: 10 January 2008
Online Status: Offline
Posts: 4
Posted: 10 January 2008 at 4:07pm | IP Logged Quote noremorse

I have an external IIS website www.mysite.com and I want to proxy everything from an internal server 192.168.0.17. I have tried the following to no avail.

RewriteEngine On
RewriteBase /test
RewriteProxy (.*)$ http://192.168.0.17$1 [NC,U]

I expected that config to work as www.mysite.com/test but I am clearly missing something. Can you help please?



Edited by noremorse - 10 January 2008 at 4:43pm
Back to Top View noremorse's Profile Search for other posts by noremorse
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4687
Posted: 11 January 2008 at 3:47am | IP Logged Quote Anton

I guess you need the following config:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^192\.168\.0\.17$
RewriteProxy (.*)$ http://www.mysite.com/$1 [NC,U]

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


Joined: 10 January 2008
Online Status: Offline
Posts: 4
Posted: 11 January 2008 at 3:56am | IP Logged Quote noremorse

Thanks, Anton, but that doesn't work either. I want http://www.mysite.com/test to proxy http://192.168.0.17.

like

http://www.mysite.com/test/default.htm would bring back http://192.168.0.17/default.htm

and

http://www.mysite.com/test/subdir/whatever.htm would bring back http://192.168.0.17/subdir/whatever.htm

/test does not really exist as a vdir but I want to use it as the condition for the proxying. I just can't my head around the syntax of .htaccess

Back to Top View noremorse's Profile Search for other posts by noremorse
 
jlpk007
Newbie
Newbie


Joined: 07 January 2008
Online Status: Offline
Posts: 9
Posted: 11 January 2008 at 4:09am | IP Logged Quote jlpk007

noremorse wrote:

Thanks, Anton, but that doesn't work either. I want http://www.mysite.com/test to proxy http://192.168.0.17.

like

http://www.mysite.com/test/default.htm would bring back http://192.168.0.17/default.htm

and

http://www.mysite.com/test/subdir/whatever.htm would bring back http://192.168.0.17/subdir/whatever.htm

/test does not really exist as a vdir but I want to use it as the condition for the proxying. I just can't my head around the syntax of .htaccess

I am using this...you can try it
access via www.testing.com/myhome and it will redirect all traffic to 192.168.0.112 while preserving www.testing.com

RewriteEngine On
RewriteBase /
RewriteRule ^myhome$
http://www.testing.com/myhome/ [NC,R=301]
RewriteProxy ^myhome(/.*)$
http://192.168.0.112/myhome$1 [NC,U]

Back to Top View jlpk007's Profile Search for other posts by jlpk007
 
noremorse
Newbie
Newbie


Joined: 10 January 2008
Online Status: Offline
Posts: 4
Posted: 11 January 2008 at 4:44am | IP Logged Quote noremorse

jlpk007,

That works but as a redirect (the url changes and won't be accesible externally). I tried the P parameter but that just fails.



Edited by noremorse - 11 January 2008 at 4:52am
Back to Top View noremorse's Profile Search for other posts by noremorse
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4687
Posted: 11 January 2008 at 5:02am | IP Logged Quote Anton

Please try this:

RewriteEngine On
RewriteBase /
RewriteProxy ^test(/.*)$ http://192.168.0.17$1 [NC,U]

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


Joined: 10 January 2008
Online Status: Offline
Posts: 4
Posted: 11 January 2008 at 5:28am | IP Logged Quote noremorse

Anton,

That just spins with any internal IP address (I have tried to 2 different 192.168.0.x servers) but I tried this and it worked fine.

RewriteEngine On
RewriteBase /
RewriteProxy ^test(/.*)$ http://www.google.com$1 [NC,U]

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4687
Posted: 11 January 2008 at 5:43am | IP Logged Quote Anton

Try to add
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
before the rule to avoid loops.


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

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