Search squid archive

Re: Battling with setting up reverse proxy with URL rules

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

 



On 10/16/2013 03:57 PM, Ali Kheyrollahi wrote:

> I would like to (this is a minimal scenario)
> 
> 1) set up a reverse proxy on my local machine on port 3128 (or any)
> 2) have 3 servers, lets call their hostnames: host.serv1, host.serv2
> and host.serv3
> 3) I would like / (root URL) to go to host.serv1
> 4) I would like /foo  to go to host.serv2
> 5) I would like /bar  to go to host.serv2/baaaz


#3 and #4 can be done using simple cache_peer_access rules with
urlpath_regex ACLs. Here is an untested sketch:

  cache_peer serv1 parent 80 originserver ...
  cache_peer serv2 parent 80 originserver ...

  acl toServ1 urlpath_regex ^/$
  acl toServ2 urlpath_regex ^/foo$

  cache_peer_access serv1 allow toServ1
  cache_peer_access serv2 allow toServ2


I believe the "bar" to "baaz" change in your requirement #5 requires a
URL rewrite using a URL rewriter, eCAP, or ICAP. As Eliezer has said, if
you can do that rewriting on the origin server, do it there.

Do not forget to deal with URLs that do not match any of the three
patterns you have specified.


HTH,

Alex.





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

  Powered by Linux