Search squid archive

Re: Using Squid to replace apache rewrite rule and mod_proxy rewrite rule

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

 



On 9/05/2014 3:21 a.m., Kumar, Amit wrote:
> Hello,
> 
> I would like to use "squid" to fetch content on a webpage and also be able to rewrite url's just like Apache. Specifically I would like to selectively proxy a content and selectively rewrite URL. 
> Where would be a good point to start on this any quick leads or example would be of great help. I already have a squid server setup and functional.
> 
> Apache rewriteRule :
> RewriteRule ^suggest(.*)$ http://bla.bla.bla/suggest$1 [L,NC]

AFAICT this rule is invalid and never matches anything because no URL
can start with 'suggest' like that.

> Apache proxy rule
> RewriteRule ^(.*)$  http://bla.bla.bla/$1 [L,NC, P]
> 

This is configured in Squid-3.2+ with:

 acl bla src all
 deny_info http://bla.bla.bla%R bla
 http_access deny bla

However note that context for the lines is significant in both Apache
and Squid. If you have the above embeded in a VirtualHost in Apache then
replace the "src all" in my example with "dstdomain " followed by the
FQDN of that VirtualHost.

Particular to Squid ordering is important. Those lines must be in that
order, and the http_access position relative to all other http_access
determines whether it affects a request or not (they are tested top-down
in a first match wins basis).

Amos





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

  Powered by Linux