Difference between revisions of "Cache peer configuration for squid"

From Notes_Wiki
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb self="Cache peer">Squid proxy server configuration|Squid</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Squid proxy server configuration]] > [[Cache peer configuration for squid]]
=Cache peer configuration for squid=
 
==Configuring cache peer for complete browsing==
 
We can configure parent proxy such that all requests always go through parent proxy only.  This is useful in setting up proxy server when the proxy server itself does not has direct access to Internet.  This is also useful is supplying username and password to parent proxy, while creating a local proxy server which does not requires authentication.
 
<pre>
cache_peer 10.4.3.204 parent 8080 7 no-query no-digest no-netdb-exchange
prefer_direct off
never_direct allow all
</pre>
Here replace '<tt>10.4.3.204</tt>' with parent proxy address and '<tt>8080</tt>' with parent proxy port.  To supply authentication also add option '<tt>login=user:password</tt>' as
<pre>
cache_peer 10.4.3.204 parent 8080 7 no-query no-digest no-netdb-exchange login=saurabh:secret
</pre>
 


==Configuring cache peer for some specific domains==
==Configuring cache peer for some specific domains==
Line 14: Line 28:
never_direct deny all
never_direct deny all
</pre>
</pre>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Squid proxy server configuration]] > [[Cache peer configuration for squid]]

Latest revision as of 10:12, 14 July 2022

Home > CentOS > CentOS 6.x > Squid proxy server configuration > Cache peer configuration for squid

Configuring cache peer for complete browsing

We can configure parent proxy such that all requests always go through parent proxy only. This is useful in setting up proxy server when the proxy server itself does not has direct access to Internet. This is also useful is supplying username and password to parent proxy, while creating a local proxy server which does not requires authentication.

cache_peer 10.4.3.204 parent 8080 7 no-query no-digest no-netdb-exchange
prefer_direct off
never_direct allow all

Here replace '10.4.3.204' with parent proxy address and '8080' with parent proxy port. To supply authentication also add option 'login=user:password' as

cache_peer 10.4.3.204 parent 8080 7 no-query no-digest no-netdb-exchange login=saurabh:secret


Configuring cache peer for some specific domains

We can configure parent proxy for few specific domains. This can be useful if parent proxy is registered with special access on those domains. For example proxy server IP can be registered on some journal websites and we may want to use parent proxy for opening only those journal websites. All other websites can be opened directly by proxy using its own Internet connection.

Sample configuration which can achieve above requirement is:

cache_peer 10.4.3.204 parent 8080 7 no-query no-digest no-netdb-exchange
prefer_direct on
acl journal-sites dstdomain ieeexplore.ieee.org acm.org springerlink.com pubs.asce.org sciencedirect.com  epw.in
never_direct allow journal-sites
never_direct deny all


Home > CentOS > CentOS 6.x > Squid proxy server configuration > Cache peer configuration for squid