Search squid archive

Re: Reverse proxy with URL rewriting

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

 



tor 2008-05-01 klockan 00:34 +0200 skrev Sylvain Beaux:

> I read in FAQ that I need to use a external script/program which modify
> "on-the-fly" URLs.

Yes.

> But is there other possibilities to rewrite URL, I meen squid native
> possibilities ?

There is some built-in rewrite capability in the upcoming 2.7 release.

But it's quite trivial to make the needed helper. A simple 2 line perl
program does it nicely.. (add one line per rewrite)

#!/usr/bin/perl -p
BEGIN { $|=1; }
s%^http://www1.example.com%http://intranet.example.com/www1% && next;

But be warned that the web server in this kind of setup doesn't realize
that the externally requested URL is quite different from it's own view
of the URL and this will cause problems for any absolute urls found in
the content, and on redirections sent by the web server such as when you
request a folder without the traling /

> The problem is that we have to implement different scripts if we use a
> linux or a NT system so we can't be agnostic from the OS.

Perl runs fine on both...

Regards
Henrik


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux