Search squid archive

RE: Redirecting to different server based onURLpattern

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

 



ons 2007-06-13 klockan 14:26 +0000 skrev Jacobson, Martin:
> I believe that I am getting closer but want to make sure before changing
> my squid configuration file.
> 
> Currently I have it set up using the httpd_accel_host and
> httpd_accel_port
>   # IP of server
>   httpd_accel_host 172.16.7.199
>   # Port
>   httpd_accel_port 80 

Still using Squid-2.5? Upgrade to 2.6.

> After reading over these links, I believe that I need to comment out the
> above lines and add something like:

You will need the above for Squid-2.5.

Squid-2.6 is quite different, and is what the FAQ documents.

>   cache_peer 172.16.7.199 parent 80 0 no-query originserver name=server1
>   cache_peer 172.16.10.36 parent 9000 0 no-query originserver
> name=server2
>   acl bin urlpath_regex ^/cgi-bin/
>   cache_peer_access server2 allow bin
>   cache_peer_access server1 deny bin
> 
> This should pass all requests coming through the squid to server1 unless
> it has /cgi-bin/ in the URL.  Then it will be passed to server2 port
> 9000.

Looks fine.

For 2.5 you'll also need

never_direct allow all

(doesn't hurt in 2.6 either, but it's implicit in reverse proxy setups)

> Now I don't want squid to keep a cached copy of the page returned by
> either server1 or server2.  I need squid to always pass the request to
> the correct server.  Will the above configuration do this, or do I need
> to set another configuration flag?

You need to either disable caching using the cache directive (no_cache
in 2.5), or make the peers proxy-only, whichever suits your setup best.

Regards
Henrik

Attachment: signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad meddelandedel


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

  Powered by Linux