[squid-users] variable/macro, setting outgoing address

Matus UHLAR - fantomas uhlar at fantomas.sk
Wed Nov 25 14:39:21 UTC 2026


Hello,

I have multiple squid proxies, of course with different IP addresses.

Our developers want to be able to distinguish CONNECT requests from some 
clients. With CONNECT, using X-Forwared-For: seems to be impossible.


first I thought forwarding to cache_peer_access, but that would forward 
CONNECT requests as CONNECT (is it possible to 


Now we have an idea of having separate tcp_ouggoing_address on each proxy 
for a few ACLs, but have the same config file on all of them
(so I don't have to maintain separate configs).


Is it possible to have kind of variable/macro that would be defined in 
included (conf.d) file, to be used in config_file instead of local IP 
address?



... At my former employer, I used trick to have squid listen on per-host IP
by using hostname defined in /etc/hosts, different on each system:

http_post hostname:3128

Unfortunately, this is not usable now, as we need to have hosts in sync
(we have many DNS overrides) and there's only one hosts_file possible.


... I also thought of using tcp_outgoing_mark and do the NAT in firewall.

But http://www.squid-cache.org/Doc/config/
says that directives hosts_file, tcp_outgoing_address, tcp_outgoing_mark and 
tcp_outgoing_tos don't exist, is this for real?


Thanks for any hints

-- 
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Chernobyl was an Windows 95 beta test site.


More information about the squid-users mailing list