[squid-users] Reverse Proxy Rewrite (perl) Question

From: Jim Flowers <jflowers@dont-contact.us>
Date: Sat, 31 Jul 2004 14:02:50 -0500

I am using reverse proxy squid where I need to rewrite addresses. For
testing I am using the following perl expression:

s|http:\/\/([^/]*).at.alt_host.us|http:\/\/$1|;

The idea is to strip off the .at.alt_host.us information before connecting
to an origin server so that a name based origin server will serve the
appropriate pages.

This works great except when the original URL includes a trailing slash but,
if not, the pages are sent to the browser direct from the origin server (not
what I want).

OK

--
http://www.originsite.com.at.alt_host.us/
http://www.originsite.com.at.alt_host.us/subdir/
Not OK
------
http://www.originsite.com.at.alt_host.us
http://www.originsite.com.at.alt_host.us/subdir
http://www.originsite.com.at.alt_host.us looks like it works (it shows that 
URL in the Address window, anyway) but any relative references followed are 
served direc from the origin server.
Can anyone suggest a fix?
Thanks.
--
Jim Flowers<jflowers@ezo.net>
Received on Sat Jul 31 2004 - 13:02:43 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Aug 01 2004 - 12:00:03 MDT