httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Rewriting / proxy problem
Date Wed, 26 Mar 2003 14:15:07 GMT
Plain text please...

Check out http://httpd.apache.org/docs/dns-caveats.html - it looks like
apache will use DNS no matter what nsswitch.conf says. So you'll always
get a loop with this setup...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>  -----Original Message-----
> From: 	Felix Planjer [mailto:Felix.Planjer@YellowRed.nl] 
> Sent:	Mittwoch, 26. März 2003 14:57
> To:	users@httpd.apache.org
> Subject:	[users@httpd] Rewriting / proxy problem
> 
> Hi,
> 
> I'm running RedHat Linux 8.0 with Apache 2.0.40. I'm trying to achieve
the following:
> 
> We have a website with an external addres:
mysite.mydomain.com/somepath/. 
> Since the "somepath" part is not running on our main server, we need
to proxy the url to another machine (on our intranet). BUT the hostname
in the proxied request should be the same as the hostname on the outside
(due to some bad coding on the site, which I have no control over).
> 
> To accomplish this I added a line to the /etc/hosts file: 
> 	192.168.100.39 mysite.mydomain.com
> So it overrules the dns lookup of mysite.mydomain.com (which resolves
to the external address)
> 
> And added the following in our httpd.conf (inside the default virtual
host):
> 	RewriteRule ^/somepath(.*) http://mysite.mydomain.com/somepath$1
[P]
> 
> The weird thing is, that it then proxies to the apache server instead
of the internal server. I get a proxy loop errors and see in the logs
that there are a lot of requests coming in from the machines own ip
address.
> 
> To verify the use of the etc/hosts file I added this entry to the
hosts file:
> 	192.168.100.39 dummyname
> 
> And replaced the FQDN in the rewrite rule with dummyname. This made
the proxy'ing work but the site wasn't working because the hostname was
wrong.
> 
> It seems that mod_rewrite are resolving from dns first, and if that
fails from the /etc/hosts file. I expect it to be the other way around.
In the host.conf I have: order hosts,bind. BTW I get the same issues
when using ProxyPass instead of te rewriterules
> 
> Can someone explain this or give me a solution?
> 
> 
> Felix Planjer
>  << File: ATT196728.txt >>

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message