I know, that I can turn off X-Forwarded-For header in Squid completley by using directive "forwarded_for off" or "forwarded_for delete" globally. I would like to be able to disable that header only for specific ACLs, so I can disable this header only for given URLs and have it enabled for others. Is there any way to do that?
Squid: disable X-Forwarded-For, but only for specific ACLs
squidx-forwarded-for
Best Answer
You can create an ACL based on an external file to store URLs (easier to manage in my opinion) :
The content of
/etc/squid/NoXForwardedFor.txt
would be something like this :Then remove
X-Forwarded-From
from the header for the given ACL :Note : You can use the
dst
directive instead of thedstdomain
directive. But it requires URL host's IP address, so make sure the target domain has fixed ip address(es).Maybe some useful links for deeper understanding :