[squid-users] Squid reverse proxy. Redirect based on http header

Amos Jeffries squid3 at treenet.co.nz
Thu Sep 3 01:03:12 UTC 2015


On 3/09/2015 11:53 a.m., Sima Yi wrote:
> We run several web servers behind a squid reverse proxy.  Requests are
> directed to a different web server depending on the domain name.
> A new requirement has come up to temporarily redirect traffic with a
> specific http header to a specific web server.
> 
> Is squid capable of doing this?  Could I have an example of how to do
> it?
> 

This config example has demos for both domain an non-domain selection.
Like any ACL based thing you can mix and match the ACLs

<http://wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers#Other_Criteria_than_Domain>

For your case the example ACL called "foo" would need to be of type
"req_header" to test header values
<http://www.squid-cache.org/Doc/config/acl/>

Amos



More information about the squid-users mailing list