squid - Redirect to Another Proxy cache_peer
Posted 02-16-2010 at 12:32 PM by jvaldivia
There are sometimes when you will have to forward all your proxy requests to a parent proxy, we maybe will have so many proxys on the network but what that hell.
After configure you squid proxy (I have a <a href="http://soad1982.blogspot.com/2009/07/squid-initial-set-up.html">quick start here</a>) you will just have to add a couple of lines to redirect the proxy settings.
I know squid could change sometimes the lines, so here is the version I've running.
<!-- ::: Run Commands -->
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code><!-- ======== Start CODE ======== -->ii squid 2.7.STABLE3-4.1 Internet object cache (WWW proxy cache)
<!-- ======== END CODE=============== --></code></pre>Now its time for add the proxy parent lines:
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code>cache_peer YOURPROXY parent PROXY-PORT 0 no-digest
never_direct allow all
</code></pre>
Just replace YOURPROXY with the ip address or DNS and the PROXY-PORT for the port number.
<!-- ::: -->
Squid access logs will looks like:
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code>1266342254.295 1119 155.17.122.192 TCP_MISS/200 515 POST http://www.blogger.com/post-autosave.do - FIRST_UP_PARENT/internet.proxy.net text/javascript
</code></pre> <!-- ::: Run Commands -->
Notice the FIRST_UP_PARENT/internet.proxy.net
Don't forget always <a href="http://soad1982.blogspot.com/2009/05/install-sofware-debian.html">review</a> your daemon's logs !
--
After configure you squid proxy (I have a <a href="http://soad1982.blogspot.com/2009/07/squid-initial-set-up.html">quick start here</a>) you will just have to add a couple of lines to redirect the proxy settings.
I know squid could change sometimes the lines, so here is the version I've running.
<!-- ::: Run Commands -->
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code><!-- ======== Start CODE ======== -->ii squid 2.7.STABLE3-4.1 Internet object cache (WWW proxy cache)
<!-- ======== END CODE=============== --></code></pre>Now its time for add the proxy parent lines:
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code>cache_peer YOURPROXY parent PROXY-PORT 0 no-digest
never_direct allow all
</code></pre>
Just replace YOURPROXY with the ip address or DNS and the PROXY-PORT for the port number.
<!-- ::: -->
Squid access logs will looks like:
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 98%;"><code>1266342254.295 1119 155.17.122.192 TCP_MISS/200 515 POST http://www.blogger.com/post-autosave.do - FIRST_UP_PARENT/internet.proxy.net text/javascript
</code></pre> <!-- ::: Run Commands -->
Notice the FIRST_UP_PARENT/internet.proxy.net
Don't forget always <a href="http://soad1982.blogspot.com/2009/05/install-sofware-debian.html">review</a> your daemon's logs !
--
Total Comments 2
Comments
-
Copy-pasting, uh?
Posted 02-16-2010 at 01:59 PM by Web31337 -
Yeah I was trying to get my post on bloger here but blogger has much more power talking about blogs
Posted 05-25-2010 at 02:17 PM by jvaldivia