Re: [squid-users] Redirection - How to in English for non programmers...

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Thu, 12 Feb 2009 11:10:45 +0100

tor 2009-02-12 klockan 16:04 +1030 skrev Geoffrey ROBERTS:

> So we have url:
>
> http://host.site.name:8080/rest/of/link/todocument
>
> and we need it to become
>
> http://host.site.name/rest/of/link/todocument
>
> I am not a C programmer and I had an attempt at using the url_rewrite with a php script I copied and modified
> from the wiki, but all that happened was that squid started refusing connections, so I assume I did something wrong.
> I took out my changes from squid.conf and restarted and it's fine again.
>
> Is there a method (preferably not involving authoring scripts)that can do this easily/quickly?

You can probably do it by a cache_peer, telling Squid to connect to port
80 on that server.

cache_peer ip.of.docushare.server parent 80 0 no-query originserver name=docushare_server
acl docushare dstdomain host.site.name
cache_peer_access docushare_server allow docushare
never_direct allow docushare

If you have other cache_peer then also add
cache_peer_access <otherpeer> deny docushare
repeat for each cache_peer.

Or alternatively here is a small perl url rewriter doing the needed rewrites..

#!/usr/bin/perl -p
BEGIN { $|=1; }
s|http://host.site.name:8080\b|http://host.site.name|;

Regards
Henrik
Received on Thu Feb 12 2009 - 10:10:58 MST

This archive was generated by hypermail 2.2.0 : Thu Feb 12 2009 - 12:00:02 MST