<div dir="ltr">Thanks for help, finally it seems to be working with following configuration<div><br><div><div>http_port 3128 name=port_3128</div><div>http_port 3127 name=port_3127</div><div><br></div><div>nonhierarchical_direct off</div><div><br></div><div>acl port_3128_acl myportname port_3128</div><div>acl port_3127_acl myportname port_3127</div><div><br></div><div>always_direct deny port_3128_acl</div><div>always_direct deny port_3127_acl</div><div><br></div><div>never_direct allow port_3128_acl</div><div>never_direct allow port_3127_acl</div><div><br></div><div># 3128</div><div>cache_peer proxy1 parent 3128 0 proxy-only default name=proxy3128</div><div>cache_peer_access proxy3128 allow port_3128_acl</div><div>cache_peer_access proxy3128 deny all</div><div><br></div><div># 3127 </div><div>cache_peer proxy2 parent 3128 0 proxy-only default name=proxy3127</div><div>cache_peer_access proxy3127 allow port_3127_acl</div><div>cache_peer_access proxy3127 deny all</div></div><div><br><div>For some reason '<span style="color:rgb(80,0,80);font-size:12.8px">no-query originserver' version didn't work, so I had to change it back to '</span><font color="#500050"><span style="font-size:12.8px">proxy-only default</span></font><span style="color:rgb(80,0,80);font-size:12.8px">'</span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-20 23:26 GMT+02:00 Alex Rousskov <span dir="ltr"><<a href="mailto:rousskov@measurement-factory.com" target="_blank">rousskov@measurement-factory.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 02/20/2017 02:08 PM, Damir Bagapov wrote:<br>
<br>
> I need to configure squid in a way when all incoming requests to<br>
> 3128 port will be redirected to proxy1 (as it works now), and all<br>
> incoming requests to 3127 will be redirected to proxy2.<br>
<br>
</span><span class="">> http_port 3128<br>
> http_port 3127<br>
><br>
> acl port_3128 port 3128<br>
> acl port_3127 port 3127<br>
><br>
> # 3128<br>
> cache_peer proxy01 parent 3128 0 no-query originserver name=proxy3128<br>
> cache_peer_access proxy3128 allow port_3128<br>
> cache_peer_access proxy3128 deny port_3127<br>
><br>
> # 3127<br>
> cache_peer proxy02 parent 3128 0 no-query originserver name=proxy3127<br>
> cache_peer_access proxy3127 allow port_3127<br>
> cache_peer_access proxy3127 deny port_3128<br>
<br>
<br>
</span>You probably want to use the "myport" ACLs instead of the "port" ACLs<br>
because you route based on the Squid listening port, not the origin<br>
server listening port.<br>
<br>
I hope you do not need those "deny" rules for cache_peer_access<br>
directives because the default -- reverse the last action [for the same<br>
peer] -- should work fine. If you want or need to have explicit deny<br>
rules, use "deny all" to clarify the intent and avoid the "what if none<br>
of the cache_peer_access rules match for a peer?" concerns.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Damir</div></div></div>
</div>