RE: [users@httpd] Newbie query about proxypass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: de Groot, Peter [mailto:peter.de.groot@xxxxxxxxxxxxxxx]
> Sent: Montag, 23. Mai 2005 11:47
> To: users@xxxxxxxxxxxxxxxx
> Subject: RE: [users@httpd] Newbie query about proxypass
> 
> 
> 
> Many thanks for the help, and some excellent reading :-)
> 
> However ... I am still getting inconsistant results, both myself and 
> my testing off-site people.  
> 
> Have I done it correctly ?  Code below.
> 
> I am wondering ... I am proxy-ing to an IIS with its default 
> file set (index.htm).
> Is my directory listing restrictions comflicting with those 
> on the IIS server.
> 
> For instance ... A lookup of  
> http://egshs.wa.edu.au/weather/index.htm works perfectly, whereas
>  http://egshs.wa.edu.au/weather seems to fail dismally :-(

First off, congratulations for posting your real URL - it makes it so much easier to debug when you can hit a live server. I wish some more posters were a similarly non-paranoid...

Your problem is that the second URL immediately returns the content of the page (ie, index.htm). So the client thinks that "http://egshs.wa.edu.au/weather"; is a page under the docroot. (ie, not a dir). Therefore, any links in it (like <img src=Current/OutsideTemp.gif> turn into a request for http://egshs.wa.edu.au/Current/OutsideTemp.gif - this is not where the image is found so it fails.

You need to cause a redirect to http://egshs.wa.edu.au/weather/ so that the browser sees that it's a sub-directory and so requests the image links as http://egshs.wa.edu.au/weather/Current/OutsideTemp.gif.

See below for the fix... 
> 
> Regards
> Peter
> 
> 
> # -----------------------------------------------------------------
> # -- PdeG changed this
> 
> HostnameLookups  off
> 
> #  --- PdeG
> #
> <VirtualHost *:80>
>   ServerName       egshs.wa.edu.au
>   ServerAlias  www.egshs.wa.edu.au
>   DocumentRoot /mnt/hd/website
>   UseCanonicalName On
> </VirtualHost>
> 
> <Directory "/mnt/hd/website">
> 
>      Options -Indexes FollowSymLinks MultiViews
>      DirectoryIndex   index.html
> 
>      AllowOverride None
> 
>      Order allow,deny
>      Allow from all
> </Directory>
> 
> 
> # RewriteEngine on
> # RewriteRule    /weather$           weather/  [R]

You should've left this in...

> 
> ProxyRequests off
> ProxyPass            /weather   http://ms-weather.egshs.local
> ProxyPassReverse     /weather   http://ms-weather.egshs.local

The ProxyPass is passing the request to the proxy as if it's a file - it hasn't realised that the resource is a directory.

Re-reading my earlier comment, I had overlooked that the "weather" resource was immediately proxied so that's why the automatic redirection didn't work and why you still need the RewriteRule. So do it like this:

	RewriteEngine on
	RewriteRule    /weather$           weather/  [R]
 
	ProxyRequests off
	ProxyPass            /weather/   http://ms-weather.egshs.local/
	ProxyPassReverse     /weather/   http://ms-weather.egshs.local/

Note trailing slashes added..

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


> #
> #
> 
> 
> 
> 
> Peter de Groot
> System Administrator
> Eastern Goldfields Senior High School
> Kalgoorlie 6430
> Mob:  0418915312
>  
> 
> 
> -----Original Message-----
> From: Boyle Owen [mailto:Owen.Boyle@xxxxxxx] 
> Sent: Thursday, 19 May 2005 5:55 PM
> To: users@xxxxxxxxxxxxxxxx
> Subject: RE: [users@httpd] Newbie query about proxypass
> 
> 
> > -----Original Message-----
> > From: de Groot, Peter [mailto:peter.de.groot@xxxxxxxxxxxxxxx]
> > Sent: Donnerstag, 19. Mai 2005 10:32
> > To: users@xxxxxxxxxxxxxxxx
> > Subject: [users@httpd] Newbie query about proxypass
> > 
> > 
> > 
> > 
> > Please help :-)
> > 
> > New to Apache and am trying to setup a proxy pass to our
> > weather station
> > Website running on IIS on a PC on our internal network.   
> > Accessable vie
> > 
> >         http://egshs.wa.edu.au/weather
> > 
> > Am having a few probs ... Starting with this one. .. The dreaded 
> > trailing slash ;-)
> > 
> > According to all the doc I have managed to google this 
> rewrite should 
> > work.
> > 
> > The problem is that I have to do a refresh the first time I 
> access the 
> > site with MS browsers... Otherwise the in-page images do 
> not come up. 
> > After the first
> > refresh it is fine ....
> 
> I do not see this behaviour with IE6.0... The images load first time.
> 
> > 
> > Any thoughts ...... Extract below.
> > 
> > 
> > 
> > RewriteEngine on
> > RewriteRule    /weather$           weather/  [R]
> 
> This is a standard prescription for the trailing-slash 
> problem. However, you can avoid the problem entirely by 
> setting ServerName and UseCanonicalName correctly. If you do 
> this, apache will make a self-referential URL automatically 
> and you won't need to bother with mod_rewrite - see 
> http://httpd.apache.org/docs-2.0/server-wide.html#identificati
> on for details.
>  
> > ProxyRequests off
> > ProxyPass            /weather   http://ms-weather.egshs.local/
> > ProxyPassReverse     /weather   http://ms-weather.egshs.local/
> 
> Your use of trailing slashes is inconsistent here. Either:
> 
> 	ProxyPass /weather/ http://ms-weather.egshs.local/
> or:
> 	ProxyPass /weather  http://ms-weather.egshs.local
> 
> (use / on both paths or neither). However, this doesn't 
> really matter - your setup will just lead to a proxy request 
> to http://ms-weather.egshs.local//some-file which still works...
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored. 
> 
> 
> 
> 
> > 
> > TIA
> > Regards
> > 
> > 
> > Peter de Groot
> > System Administrator
> > Eastern Goldfields Senior High School
> > Kalgoorlie 6430
> > Mob:  0418915312
> >  
> > 
> > 
> ---------------------------------------------------------------------
> > 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@xxxxxxxxxxxxxxxx
> >    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> > 
> > 
> Diese E-mail ist eine private und persönliche Kommunikation. 
> Sie hat keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der 
> SWX Gruppe. This e-mail is of a private and personal nature. 
> It is not related to the exchange or business activities of 
> the SWX Group. Le présent e-mail est un message privé et 
> personnel, sans rapport avec l'activité boursière du Groupe SWX.
>  
>  
> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
> 
> ---------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
> 

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux